Skip to content

zycR10/LeetcodeSolutions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

298 Commits
 
 
 
 
 
 
 
 

Repository files navigation

LeetCode部分算法题解题思路

主要整理归纳了一些获得评价很高的或者我个人认为解法很巧妙的算法题的解法分析和思路。个人认为无论是真的喜爱算法还是说只是为了面试中能够有更好的表现,算法一定要一类一类的去学,同类型的算法大致思路是差不多的,而且最重要的就是思想,真正实现了思想的代码可能就是短短几行


数组

1.Two Sum
15.Three Sum
33.Search in Rotated Sorted Array
34.Find First and Last Position of Element in Sorted Array
35.Search Insert Position
39.Combination Sum
40.Combination Sum II
41.First Missing Positive
45.Jump Game II
48.Rotate Image
49.Group Anagrams
53.Maximum Subarray
73.Set Matrix Zeros
74. Search a 2D Matrix
75. Sort Colors
79. Word Search
118. Pascal's Triangle
119. Pascal's Triangle II
121. Best Time to Buy and Sell Stock
122. Best Time to Buy and Sell Stock II
123. Best Time to Buy and Sell Stock III
128. Longest Consecutive Sequence
136. Single Number
137. Single Number II
153. Find Minimum in Rotated Sorted Array
154. Find Minimum in Rotated Sorted ArrayII
167. Two Sum II - Input array is sorted
169. Majority Element

字符串

3.Longest Substring Without Repeating Characters
5.Longest Palindromic Substring
20. Valid Parentheses

链表

19. Remove Nth Node From End of List
21. Merge Two Sorted Lists
23. Merge k Sorted Lists
24. Swap Nodes in Pairs
83. Remove Duplicates from Sorted List
92. Reverse Linked List II
141. Linked List Cycle
142. Linked List Cycle II
143. Reorder List
148. Sort List
160. Intersection of Two Linked Lists

回溯

22. Generate Parentheses 46. Permutations
46. PermutationsII
77. Combinations
78. Subsets
90. SubsetsII
131. Palindrome Partitioning

动态规划

32. Longest Valid Parentheses
62. Unique Paths
63. Unique PathsII
64. Minimum Path Sum
96. Unique Binary Search Trees
120. Triangle
152. Maximum Product Subarray

贪心算法

55.Jump Game II

98. Validate Binary Search Tree
100. Same Tree
101. Symmetric Tree
102. Binary Tree 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
107. Binary Tree Level Order Traversal II
108. Convert Sorted Array to Binary Search Tree
109. Convert Sorted List to Binary Search Tree
110. Balanced Binary Tree
112. Path Sum
113. Path Sum II
114. Flatten Binary Tree to Linked List
124. Binary Tree Maximum Path Sum
129. Sum Root to Leaf Numbers
173. Binary Search Tree Iterator

About

solutions for leetcode

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages