LeetCode | 刷题日志
-
142. Linked List Cycle II
Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Note…
-
49. Group Anagrams
Given an array of strings, group anagrams together. For example, given: [“eat”, “tea”, “tan”, “ate”,…
-
Queue & Stack解题方法小结
LeetCode上的相关题目(easy) 155, 225, 232, 346 常用方法 Stack: push(), pop(), peak(), empty() Queue(LinkedList)…
-
346. Moving Average from Data Stream
Given a stream of integers and a window size, calculate the moving average of all integers in the sl…
-
155. Min Stack
Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. pu…
-
225. Implement Stack using Queues
Implement the following operations of a stack using queues. push(x) — Push element x onto stac…
-
232. Implement Queue using Stacks
Implement the following operations of a queue using stacks. push(x) — Push element x to the ba…
-
Array解题方法小结
LeetCode上的相关题目(easy) 26, 27, 35, 48, 88 118, 119, 121, 122, 136, 162, 167, 169 217, 219, 243, 268, …
-
LinkedList解题方法小结
LeetCode上相关的题目(easy) 2, 21, 82, 83, 86, 141, 160, 203, 206, 234, 237 Medium题目 142 技巧 双指针,一个走两步,一个走一步…
-
LeetCode – 141. Linked List Cycle
Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using ext…
-
LeetCode – 160. Intersection of Two Linked Lists
Write a program to find the node at which the intersection of two singly linked lists begins. …
-
LeetCode – 234. Palindrome Linked List
Given a singly linked list, determine if it is a palindrome. Follow up:Could you do it in O(n) time …
-
LeetCode – 206. Reverse Linked List
Reverse a singly linked list. 这道题非常基础,需要熟练掌握 /** * Definition for singly-linked list. * public class…
-
LeetCode – 2. Add Two Numbers
You are given two non-empty linked lists representing two non-negative integers. The digits are stor…
-
LeetCode – 21. Merge Two Sorted Lists
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing t…