You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-7Lines changed: 9 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -247,6 +247,7 @@ Your ideas/fixes/algorithms are more than welcome!
247
247
|236|[Lowest Common Ancestor of a Binary Tree](https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-tree/)|[Solution](../master/src/main/java/com/stevesun/solutions/_236.java)| O(n)|O(h) | Medium| DFS
248
248
|235|[Lowest Common Ancestor of a Binary Search Tree](https://leetcode.com/problems/lowest-common-ancestor-of-a-binary-search-tree/)|[Solution](../master/src/main/java/com/stevesun/solutions/_235.java)| O(h)|O(1) | Easy| DFS
249
249
|233|[Number of Digit One](https://leetcode.com/problems/number-of-digit-one/)|[Solution](../master/src/main/java/com/stevesun/solutions/NumberofDigitOne.java)| O(n)|O(1) | Hard| Math
250
+
|232|[Implement Queue using Stacks](https://leetcode.com/problems/implement-queue-using-stacks/)|[Solution](../master/src/main/java/com/stevesun/solutions/_232.java)| O(n)|O(n) | Medium| Stack, Design
250
251
|229|[Majority Element II](https://leetcode.com/problems/majority-element-ii/)|[Solution](../master/src/main/java/com/stevesun/solutions/MajorityElementII.java)| O(n)|O(n) | Medium|
@@ -272,6 +273,7 @@ Your ideas/fixes/algorithms are more than welcome!
272
273
|201|[Bitwise AND of Numbers Range](https://leetcode.com/problems/bitwise-and-of-numbers-range/)|[Solution](../master/src/main/java/com/stevesun/solutions/_201.java)| O(min(m,n))|O(1) | Medium | Bit Manipulation
273
274
|200|[Number of Islands](https://leetcode.com/problems/number-of-islands/)|[Union Find](../master/src/main/java/com/stevesun/solutions/_200UnionFind.java)[DFS](../master/MEDIUM/src/medium/_200DFS.java)| O(m*n)|O(m*n) | Medium| Union Find, DFS
|191|[Number of 1 Bits](https://leetcode.com/problems/number-of-1-bits/)|[Solution](../master/src/main/java/com/stevesun/solutions/_191.java)| O(n)|O(1)| Easy | Bit Manipulation
275
277
|190|[Reverse Bits](https://leetcode.com/problems/reverse-bits/)|[Solution](../master/src/main/java/com/stevesun/solutions/ReverseBits.java)| O(n)|O(1)| Easy | Bit Manipulation
276
278
|189|[Rotate Array](https://leetcode.com/problems/rotate-array/)|[Solution](../master/src/main/java/com/stevesun/solutions/_189.java)| O(n)|O(n), could be optimized to O(1) | Easy
277
279
|187|[Repeated DNA Sequences](https://leetcode.com/problems/repeated-dna-sequences/)|[Solution](../master/src/main/java/com/stevesun/solutions/_187.java)| O(n)|O(n) | Medium
@@ -290,7 +292,7 @@ Your ideas/fixes/algorithms are more than welcome!
|160|[Intersection of Two Linked Lists](https://leetcode.com/problems/intersection-of-two-linked-lists/)|[Solution](../master/src/main/java/com/stevesun/solutions/IntersectionofTwoLinkedLists.java)| O(m+n)|O(1) | Easy| Linked List
295
+
|160|[Intersection of Two Linked Lists](https://leetcode.com/problems/intersection-of-two-linked-lists/)|[Solution](../master/src/main/java/com/stevesun/solutions/_160.java)| O(m+n)|O(1) | Easy| Linked List
294
296
|159|[Longest Substring with At Most Two Distinct Characters](https://leetcode.com/problems/longest-substring-with-at-most-two-distinct-characters/)|[Solution](../master/src/main/java/com/stevesun/solutions/LongestSubstringwithAtMostTwoDistinctCharacters.java)| O(n)|O(1) | Hard| String, Sliding Window
295
297
|158|[Read N Characters Given Read4 II - Call multiple times](https://leetcode.com/problems/read-n-characters-given-read4-ii-call-multiple-times/)|[Solution](../master/src/main/java/com/stevesun/solutions/ReadNCharactersGivenRead4IICallMultipleTimes.java)| O(n)|O(1) | Hard|
296
298
|157|[Read N Characters Given Read4](https://leetcode.com/problems/read-n-characters-given-read4/)|[Solution](../master/src/main/java/com/stevesun/solutions/ReadNCharactersGivenRead4.java)| O(n)|O(1) | Easy|
@@ -339,7 +341,7 @@ Your ideas/fixes/algorithms are more than welcome!
339
341
|105|[Construct Binary Tree from Preorder and Inorder Traversal](https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/)|[Solution](../master/src/main/java/com/stevesun/solutions/_105.java)| O(n)|O(n) | Medium| Recursion, Tree
340
342
|104|[Maximum Depth of Binary Tree](https://leetcode.com/problems/maximum-depth-of-binary-tree/)|[Solution](../master/src/main/java/com/stevesun/solutions/MaximumDepthOfBinaryTree.java)| O(n)|O(h) | Easy| DFS
341
343
|103|[Binary Tree Zigzag Level Order Traversal](https://leetcode.com/problems/binary-tree-zigzag-level-order-traversal/)|[Solution](../master/src/main/java/com/stevesun/solutions/_103.java)| O(n)|O(h) | Medium| BFS,DFS
342
-
|102|[Binary Tree Level Order Traversal](https://leetcode.com/problems/binary-tree-level-order-traversal/)|[Solution](../master/src/main/java/com/stevesun/solutions/BinaryTreeLevelOrderTraversal.java)| O(n)|O(h) | Easy| BFS
344
+
|102|[Binary Tree Level Order Traversal](https://leetcode.com/problems/binary-tree-level-order-traversal/)|[Solution](../master/src/main/java/com/stevesun/solutions/_102.java)| O(n)|O(h) | Medium| BFS
343
345
|99|[Recover Binary Search Tree](https://leetcode.com/problems/recover-binary-search-tree/)|[Solution](../master/src/main/java/com/stevesun/solutions/RecoverBinarySearchTree.java)| O(?) | O(?) | Hard |
|34|[Search for a Range](https://leetcode.com/problems/search-for-a-range/)|[Solution](../master/src/main/java/com/stevesun/solutions/SearchForARange.java)|O(logn)|O(1)|Medium|Array, Binary Search
398
-
|33|[Search in Rotated Sorted Array](https://leetcode.com/problems/search-in-rotated-sorted-array/)|[Solution](../master/src/main/java/com/stevesun/solutions/SearchinRotatedSortedArray.java)|O(logn)|O(1)|Hard|Binary Search
400
+
|33|[Search in Rotated Sorted Array](https://leetcode.com/problems/search-in-rotated-sorted-array/)|[Solution](../master/src/main/java/com/stevesun/solutions/_33.java)|O(logn)|O(1)|Medium|Binary Search
|30|[Substring with Concatenation of All Words](https://leetcode.com/problems/substring-with-concatenation-of-all-words/)|[Solution](../master/src/main/java/com/stevesun/solutions/SubstringwithConcatenationofAllWords.java)|O(n^2)|O(n)|Hard| HashMap
402
404
|29|[Divide Two Integers](https://leetcode.com/problems/divide-two-integers/)|[Solution](../master/src/main/java/com/stevesun/solutions/DivideTwoIntegers.java)|O(?)|O(?)|Medium|
|26|[Remove Duplicates from Sorted Array](https://leetcode.com/problems/remove-duplicates-from-sorted-array/)|[Solution](../master/src/main/java/com/stevesun/solutions/RemoveDuplicatesFromSortedArray.java)|O(n)|O(1)|Easy|
407
+
|26|[Remove Duplicates from Sorted Array](https://leetcode.com/problems/remove-duplicates-from-sorted-array/)|[Solution](../master/src/main/java/com/stevesun/solutions/_26.java)|O(n)|O(1)|Easy| Array
406
408
|25|[Reverse Nodes in k-Group](https://leetcode.com/problems/reverse-nodes-in-k-group/)|[Solution](../master/src/main/java/com/stevesun/solutions/ReverseNodesinkGroup.java)|O(n)|O(1)| Hard | Recursion, LinkedList
407
-
|24|[Swap Nodes in Pairs](https://leetcode.com/problems/swap-nodes-in-pairs/)|[Solution](../master/src/main/java/com/stevesun/solutions/SwapNodesinPairs.java)|O(n)|O(1)|Easy| Recursion, LinkedList
409
+
|24|[Swap Nodes in Pairs](https://leetcode.com/problems/swap-nodes-in-pairs/)|[Solution](../master/src/main/java/com/stevesun/solutions/_24.java)|O(n)|O(h)|Medium| Recursion, LinkedList
408
410
|23|[Merge k Sorted Lists](https://leetcode.com/problems/merge-k-sorted-lists/)|[Solution](../master/src/main/java/com/stevesun/solutions/MergeKSortedList.java)|O(n*logk)|O(logk)|Hard|Heap
|21|[Merge Two Sorted Lists](https://leetcode.com/problems/merge-two-sorted-lists/)|[Solution](../master/src/main/java/com/stevesun/solutions/_21.java)|O(n)|O(h)|Easy| Recursion
@@ -423,7 +425,7 @@ Your ideas/fixes/algorithms are more than welcome!
423
425
|8|[String to Integer (atoi)](https://leetcode.com/problems/string-to-integer-atoi/)|[Solution](../master/src/main/java/com/stevesun/solutions/_8.java)| O(n) | O(1) | Medium
|4|[Median of Two Sorted Arrays](https://leetcode.com/problems/median-of-two-sorted-arrays/)|[Solution](../master/src/main/java/com/stevesun/solutions/MedianofTwoSortedArrays.java) | ? | ? | Hard | Divide and Conquer
428
430
|3|[Longest Substring Without Repeating Characters](https://leetcode.com/problems/longest-substring-without-repeating-characters/)|[Solution](../master/src/main/java/com/stevesun/solutions/LongestSubstringWithoutRepeatingCharacters.java) | O(n) | O(1) | Medium | HashMap, Sliding Window
429
431
|2|[Add Two Numbers](https://leetcode.com/problems/add-two-numbers/)|[Solution](../master/src/main/java/com/stevesun/solutions/_2.java) | O(max(m,n)) | O(1) | Medium | LinkedList
0 commit comments