Leetcode Array题型总结

本文精选了LeetCode上的经典算法题目,涵盖了动态规划、贪心算法、搜索算法等多个方面,旨在帮助读者通过实战练习提高算法水平。


Dynamic Programming

62. Unique Paths         https://leetcode.com/problems/unique-paths/

63. Unique Paths II      https://leetcode.com/problems/unique-paths-ii/

120. Triangle              https://leetcode.com/problems/triangle/

42. Trapping Rain Water https://leetcode.com/problems/trapping-rain-water/

238. Product of Array Except Self   https://leetcode.com/problems/product-of-array-except-self/  

118. Pascal's Triangle      https://leetcode.com/problems/pascals-triangle/

119. Pascal's Triangle II   https://leetcode.com/problems/pascals-triangle-ii/

64. Minimum Path Sum    https://leetcode.com/problems/minimum-path-sum/

53. Maximum Subarray    https://leetcode.com/problems/maximum-subarray/

84. Largest Rectangle in Histogram   https://leetcode.com/problems/largest-rectangle-in-histogram/

162. Find Peak Element    https://leetcode.com/problems/find-peak-element/


HashSet, HashTable:用空间换时间

1. Two Sum                  https://leetcode.com/subscribe/

128. Longest Consecutive Sequence  https://leetcode.com/problems/longest-consecutive-sequence/

217. Contains Duplicate  https://leetcode.com/problems/contains-duplicate/

219. Contains Duplicate II   https://leetcode.com/problems/contains-duplicate-ii/


DFS,BackTracking

78. Subsets             https://leetcode.com/problems/subsets/

90. Subsets II               https://leetcode.com/problems/subsets-ii/

105. Construct Binary Tree from Preorder and Inorder Traversal 

https://leetcode.com/problems/construct-binary-tree-from-preorder-and-inorder-traversal/

106. Construct Binary Tree from Inorder and Postorder Traversal

https://leetcode.com/problems/construct-binary-tree-from-inorder-and-postorder-traversal/

39. Combination Sum  https://leetcode.com/problems/combination-sum/

40. Combination Sum II   on-sum-ii/

216. Combination Sum III   https://leetcode.com/problems/combination-sum-iii/


Binary Search

33. Search in Rotated Sorted Array   https://leetcode.com/problems/search-in-rotated-sorted-array/

81. Search in Rotated Sorted Array II  https://leetcode.com/problems/search-in-rotated-sorted-array-ii/

34. Search for a Range    https://leetcode.com/problems/search-for-a-range/

74. Search a 2D Matrix    https://leetcode.com/problems/search-a-2d-matrix/

153. Find Minimum in Rotated Sorted Array 

15. 3Sum    https://leetcode.com/problems/3sum/

18. 4Sum    https://leetcode.com/problems/4sum/

16. 3Sum Closest   https://leetcode.com/problems/3sum-closest/

bit manipulation

268. Missing Number

169. Majority Element   https://leetcode.com/problems/majority-element/

229. Majority Element II   https://leetcode.com/problems/majority-element-ii/      ???


数组的遍历

228. Summary Ranges     https://leetcode.com/problems/summary-ranges/

54. Spiral Matrix                https://leetcode.com/problems/spiral-matrix/

59. Spiral Matrix II            https://leetcode.com/problems/spiral-matrix-ii/

75. Sort Colors                 https://leetcode.com/problems/sort-colors/

73. Set Matrix Zeroes        https://leetcode.com/problems/set-matrix-zeroes/

35. Search Insert Position  https://leetcode.com/problems/search-insert-position/

48. Rotate Image                https://leetcode.com/problems/rotate-image/

189. Rotate Array               https://leetcode.com/problems/rotate-array/

27. Remove Element          https://leetcode.com/problems/remove-element/

26. Remove Duplicates from Sorted Array   https://leetcode.com/problems/remove-duplicates-from-sorted-array/

80. Remove Duplicates from Sorted Array II   https://leetcode.com/problems/remove-duplicates-from-sorted-array-ii/

66. Plus One                       https://leetcode.com/problems/plus-one/

31. Next Permutation          https://leetcode.com/problems/next-permutation/

209. Minimum Size Subarray Sum  https://leetcode.com/problems/minimum-size-subarray-sum/ 

88. Merge Sorted Array       https://leetcode.com/problems/merge-sorted-array/

56. Merge Intervals              https://leetcode.com/problems/merge-intervals/

 Insert Interval      https://leetcode.com/problems/insert-interval/

169. Majority Element         https://leetcode.com/problems/majority-element/

41. First Missing Positive    https://leetcode.com/problems/first-missing-positive/ ???

Greedy:

Jump Game    https://leetcode.com/problems/jump-game/

45. Jump Game II   https://leetcode.com/problems/jump-game-ii/

11. Container With Most Water  https://leetcode.com/problems/container-with-most-water/

121. Best Time to Buy and Sell Stock    https://leetcode.com/problems/best-time-to-buy-and-sell-stock/

122. Best Time to Buy and Sell Stock II   https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii/

123. Best Time to Buy and Sell Stock III  https://leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/

16. 3Sum Closest       https://leetcode.com/problems/3sum-closest/

15. 3Sum                    https://leetcode.com/problems/3sum/

18. 4Sum                    https://leetcode.com/problems/4sum/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值