Data Structures and Algorithms implemented by Python 3.
Index
- arrays
- 1. Two Sum
- 4. Median of Two Sorted Arrays
- 11. Container With Most Water
- 15. 3Sum
- 16. 3Sum Closest
- 26. Remove Duplicates from Sorted Array
- 31. Next Permutation
- 33. Search in Rotated Sorted Array
- 34. Find First and Last Position of Element in Sorted Array
- 39. Combination Sum
- 48. Rotate Image
- 54. Spiral Matrix
- 55. Jump Game
- 56. Merge Intervals
- 66. Plus One
- 75. Sort Colors
- 84. Largest Rectangle in Histogram
- 88. Merge Sorted Array
- 118. Pascal's Triangle
- 119. Pascal's Triangle II
- 122. Best Time to Buy and Sell Stock II
- 169. Majority Element
- 189. Rotate Array
- 217. Contains Duplicate
- 238. Product of Array Except Self
- 283. Move Zeroes
- 287. Find the Duplicate Number
- 448. Find All Numbers Disappeared in an Array
- 509. Fibonacci Number
- 581. Shortest Unsorted Continuous Subarray
- linked list
- bfs
- dfs
- divide and conquer
- recursion
- sort
- stack
- trie
- hash table
- bit-manipulation
- math
- back tracking
- dynamic programming
- 5. Longest Palindromic Substring
- 10. Regular Expression Matching
- 53. Maximum Subarray
- 62. Unique Paths
- 63. Unique Paths II
- 64. Minimum Path Sum
- 70. Climbing Stairs
- 72. Edit Distance
- 121. Best Time to Buy and Sell Stock
- 133. Clone Graph
- 139. Word Break
- 152. Maximum Product Subarray
- 207. Course Schedule
- 210. Course Schedule II
- 221. Maximal Square
- 300. Longest Increasing Subsequence
- 322. Coin Change
- 343. Integer Break
- string
- 3. Longest Substring Without Repeating Characters
- 5. Longest Palindromic Substring
- 6. ZigZag Conversion
- 8. String to Integer
- 13. Roman To Integer
- 14. Longest Common Prefix
- 17. Letter Combinations of a Phone Number
- 20. Valid Parentheses
- 22. Generate Parentheses
- 28. Implement strStr()
- 38. Count and Say
- 49. Group Anagrams
- 125. Valid Palindrome
- 344. Reverse String
- sliding window
- tree
- 94. Inorder Traversal
- 95. Unique Binary Search Trees II
- 96. Unique Binary Search Trees
- 98. Validate Binary Search Tree
- 100. Same Tree
- 101. Symmetric Tree
- 102. Level Order Traversal
- 103. Binary Tree Zigzag Level Order Traversal
- 104. Maximum Depth of Binary Tree
- 105. Construct Binary Tree from Preorder and Inorder Traversal
- 106. Construct Binary Tree from Inorder and Postorder Traversal
- 108. Convert Sorted Array to Binary Search Tree
- 112. Path Sum
- 114. Flatten Binary Tree to Linked List
- 144. Preorder Traversal
- 145. Postorder Traversal
- 226. Invert Binary Tree
- 236. Lowest Common Ancestor of a Binary Tree
- 297. Serialize and Deserialize Binary Tree
- 437. Path Sum III
- 538. Convert BST to Greater Tree
- 543. Diameter of Binary Tree
- 617. Merge Two Binary Trees
note: 94, 144, 145 have recursive and iterative solutions.
- graph
- 十大排序算法
- 剑指offer
- 01. Search in 2d array
- 02. Replace space
- 03. Print List From Tail To Head
- 04. Reconstruct Binary Tree
- 05. Stack to Queue
- 06. Min Number In Rotate Array
- 07. Fibonacci
- 08. Jump Floor
- 09. Jump Floor II
- 10. Rect Cover
- 11. Number of 1
- 12. Power
- 13. ReOrder Array
- 14. Find K-th To Tail
- 15. Reverse List
- 16. Merge
- 17. Has Subtree
- 18. Mirror
- 19. Print Matrix
- 20. Define Stack
- 21. Is Pop Order
- 22. Print From Top To Bottom
- 22-1. Level Order Traversal 1
- 22-2. Zigzag Level Order Traversal
- 23. Verify Sequence of BST
- 24. Find Path
- 25. Clone Complex Linked List
- 26. Convert BST to DLL
- 27. Permutation
- 28. More Than Half Num
- 29. Get Least Numbers
- 30. Find Greatest Sum Of SubArray
- 31. Number Of 1 Between 1 And N
- 32. Print Min Number
- 33. Get Ugly Number
- 34. First Not Repeating Char
- 40. Find Nums Appear Once
- 40-1. Find Nums Appear Once
- 48. Add
- 50. Duplicate
- 50-1. Duplicate
- 52. Regular Expression Matching
- 53. Is Numeric
- 55. Entry Node Of Loop
- 56. Delete Duplication
- 57. Get Next Node of Binary Tree
- 58. Symmetrical Tree
- 62. Kth Node In BST
- 64. Max In Windows
- 65. Path in Matrix
- 66. Motion Range
- Print 1 To Max N Digits
- 1.2 Print Tree
- 1.4 Rotate Two strings
- 2.13 Small-range sort
- 2.14 Check Duplicate
- 2.15 Merge Two Sorted Array
- 2.17 Sort Three Color
- 2.18 Search in sorted matrix
- 2.19 Require shortest subsequence
- 2.20 Max Gap
- 8.3 Swap without extra variable
- 8.4 Comparison without operation
- 8.5 Search odd
- 8.6 Search odds
- others
- fundamentals
- nowcoder
- Highest score
- Matrix Transpose
- Random-Fixed length string
- Remove List Duplication
- List Monotonicity
- How many triangles? (8.28 HUAWEI 1)
- AUC
- Delete char in string
- Permutation of goods (9.6 ZTE)
- Union Find tutorial
- Matrix Path (8.28 HUAWEI 2)
- Delete Operation for Two Lists (8.28 HUAWEI 3)
- Skills Permutation
- Longest Common Substring
- Length of sorted list after romving redundance (9.12 58同城 1)
- Same with leetcode candy (9.12 58同城 2)
- Same with minimum path sum (9.12 58同城 3)
The interactive features of the notebook will not work in my repo on GitHub. For an example, you might see error message like this:
To view Jupyter online or share with others, you can use nbviewer.
To view a fully interactive version of Jupyter Notebook, you can set up a notebook server locally. For more information, see Jupyter's official documentation.