leetcode刷题规划

本文汇总了LeetCode中各类经典算法题目,包括数组、字符串、链表、队列、栈、高级数据结构等,涵盖了基础算法如二分搜索、广度优先搜索以及深度优先搜索等,并探讨了动态规划、回溯法等进阶技巧。通过这些题目,读者可以系统提升解决复杂问题的能力。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

LeetCode精华题目列表【刷题规划系列】 – TuringPlanet

目录

算法题到底在考察什么?

题目列表

Array

String

Linked List

Queue

Stack

Advanced Data Structures

HashSet / HashTable

Tree

Heap

Graph (Breadth-FS)

Graph (Best-FS)

Graph (DFS)

Basic Algorithms

Binary Search

Breadth-First Search

Best-First Search

Depth-First Search

Backtracking

Dynamic Programming 1D

Dynamic Programming 1D (Multiple States)

Dynamic Programming 2D (2D Input)

Dynamic Programming 2D (Two 1D Inputs)

Dynamic Programming 2D (1D Input)

Dynamic Programming 2D (1D Input + K)

Dynamic Programming (Knapsack)

Advanced Algorithms

Trie

Union Find

Topological Sort

Boyer-Moore Voting Algorithm

Complex Problems

HashTable + Doubly Linked List


算法题到底在考察什么?
 

算法题→系统性解决问题的能力

  • 题目分析
  • 算法应用
  • 系统性阐述思路

题目列表

Array

Classic ProblemsSimilar Problems
189. Rotate Array
88. Merge Sorted Array
1260. Shift 2D Grid
941. Valid Mountain Array
283. Move Zeros
167. Two Sum II – Input array is sorted
167. Two Sum II – Input array is sorted
26. Remove Duplicates from Sorted Array80. Remove Duplicates from Sorted Array II
56. Merge Intervals
11. Container With Most Water
31. Next Permuation
442. Find All Duplicates in an Array
48. Rotate Image
75. Sort Colors
57. Insert Interval
42. Trapping Rain Water

String

Classic ProblemsSimilar Problems
551. Student Attendance Record I
344. Reverse String
937. Reorder Data in Log Files
824. Goat Latin
415. Add Strings
14. Longest Common Prefix
28. Implement strStr()
6. ZigZag Conversion
8. String to Integer (atoi)
443. String Compression
151. Reverse Words in a String186. Reverse Words in a String II557. Reverse Words in a String III
809. Expressive Words
616. Add Bold Tag in String
848. Shifting Letters
68. Text Justification
1328. Break a Palindrome

Linked List

Classic ProblemsSimilar Problems
876. Middle of the Linked List
21. Merge Two Sorted Lists
237. Delete Node in a Linked List
206. Reverse Linked List92. Reverse Linked List II24. Swap Nodes in Pairs25. Reverse Nodes in k-Group
234. Palindrome Linked List
83. Remove Duplicates from Sorted List82. Remove Duplicates from Sorted List II
141. Linked List Cycle142. Linked List Cycle II
2. Add Two Numbers445. Add Two Numbers II
19. Remove Nth Node From End of List
708. Insert into a Sorted Circular Linked List
147. Insertion Sort List
725. Split Linked List in Parts

Queue

Classic ProblemsSimilar Problems
346. Moving Average from Data Streamy
225. Implement Stack using Queues
622. Design Circular Queue

Stack

Classic ProblemsSimilar Problems
22. Valid Parentheses
1249.Minimum Remove to Make Valid Parentheses
1021. Remove Outermost Parentheses
232. Implement Queue using Stacks
682. Baseball Game
155. Min Stack
496. Next Greater Element I503. Next Greater Element II739. Daily Temperatures1019. Next Greater Node In Linked List
1249. Minimum Remove to Make Valid Parentheses
173. Binary Search Tree Iterator
636. Exclusive Time of Functions
394. Decode String224. Basic Calculator
71. Simplify Path
735. Asteroid Collision
150. Evaluate Reverse Polish Notation
32. Longest Valid Parentheses
84. Largest Rectangle in Histogram85. Maximal Rectangle
895. Maximum Frequency Stack

Advanced Data Structures

HashSet / HashTable

Classic ProblemsSimilar Problems
1. Two Sum15. 3Sum18. 4Sum
349. Intersection of Two Arrays
953. Verifying an Alien Dictionary
359. Logger Rate Limiter
1002. Find Common Characters
811. Subdomain Visit Count
3. Longest Substring Without Repeating Characters
560. Subarray Sum Equals K974. Subarray Sums Divisible by K
380. Insert Delete GetRandom O(1)
49. Group Anagrams438. Find All Anagrams in a String
138. Copy List with Random Pointer133. Clone Graph
166. Fraction to Recurring Decimal
356. Line Reflection
535. Encode and Decode TinyURL
554. Brick Wall
966. Vowel Spellchecker
340. Longest Substring with At Most K Distinct Characters
76. Minimum Window Substring

Tree

Classic ProblemsSimilar Problems
543. Diameter of Binary Tree124. Binary Tree Maximum Path Sum
226. Invert Binary Tree
104. Maximum Depth of Binary Tree559. Maximum Depth of N-ary Tree
101. Symmetric Tree
108. Convert Sorted Array to Binary Search Tree
112. Path Sum113. Path Sum II437. Path Sum III
105. Construct Binary Tree from Preorder and Inorder Traversal1008. Construct Binary Search Tree from Preorder Traversal889. Construct Binary Tree from Preorder and Postorder Traversal
98. Validate Binary Search Tree
236. Lowest Common Ancestor of a Binary Tree
103. Binary Tree Zigzag Level Order Traversal
199. Binary Tree Right Side View
987. Vertical Order Traversal of a Binary Tree
114. Flatten Binary Tree to Linked List
979. Distribute Coins in Binary Tree
116. Populating Next Right Pointers in Each Node117. Populating Next Right Pointers in Each Node II
1123. Lowest Common Ancestor of Deepest Leaves
337. House Robber III
450. Delete Node in a BST
297. Serialize and Deserialize Binary Tree449. Serialize and Deserialize BST428. Serialize and Deserialize N-ary Tree
968. Binary Tree Cameras

Heap

Classic ProblemsSimilar Problems
703. Kth Largest Element in a Stream215. Kth Largest Element in an Array692. Top K Frequent Words1387. Sort Integers by The Power Value
253. Meeting Rooms II
373. Find K Pairs with Smallest Sums
973. K Closest Point to Origin
767. Reorganize String
378. Kth Smallest Element in a Sorted Matrix
264. Ugly Number II
358. Rearrange String k Distance Apart
23. Merge k Sorted Lists
295. Find Median from Data Stream
407. Trapping Rain Water II
818. Race Car

Graph (Breadth-FS)

Classic ProblemsSimilar Problems
310. Minimum Height Trees
1162. As Far from Land as Possible
934. Shortest Bridge
542. 01 Matrix
1129. Shortest Path with Alternating Colors

Graph (Best-FS)

Classic ProblemsSimilar Problems
743. Network Delay Time
1102. Path With Maximum Minimum Value
787. Cheapest Flights Within K Stops

Graph (DFS)

Classic ProblemsSimilar Problems
332. Reconstruct Itinerary
200. Number of Islands305. Number of Islands II
694. Number of Distinct Islands
785. Is Graph Bipartite?886. Possible Bipartition
399. Evaluate Division
261. Graph Valid Tree
841. Keys and Rooms
1059. All Paths from Source Lead to Destination
417. Pacific Atlantic Water Flow

Basic Algorithms

Binary Search

Classic ProblemsSimilar Problems
69. Sqrt(x)50. Pow(x, n)
852. Peak Index in a Mountain Array162. Find Peak Element1095. Find in Mountain Array
704. Binary Search34. Find First and Last Position of Element in Sorted Array
29. Divide Two Integers
33. Search in Rotated Sorted Array81. Search in Rotated Sorted Array II
153. Find Minimum in Rotated Sorted Array154. Find Minimum in Rotated Sorted Array II
74. Search a 2D Matrix
875. Koko Eating Bananas1062. Longest Repeating Substring1011. Capacity To Ship Packages Within D Days1292. Maximum Side Length of a Square with Sum Less than or Equal to Threshold
1231. Divide Chocolate410. Split Array Largest Sum
4. Median of Two Sorted Arrays
528. Random Pick with Weight
1055. Shortest Way to Form String

Breadth-First Search

Classic ProblemsSimilar Problems
339. Nested List Weight Sum364. Nested List Weight Sum II
994. Rotting Oranges
127. Word Ladder126. Word Ladder II
863. All Nodes Distance K in Binary Tree
909. Snakes and Ladders
967. Numbers With Same Consecutive Differences
752. Open the Lock
675. Cut Off Trees for Golf Event
773. Sliding Puzzle

Best-First Search

Classic ProblemsSimilar Problems
505. The Maze II
264. Ugly Number II
818. Race Car
871. Minimum Number of Refueling Stops
778. Swim in Rising Water

Depth-First Search

Classic ProblemsSimilar Problems
733. Flood Fill
439. Ternary Expression Parser
394. Decode String224. Basic Calculator
1376. Time Needed to Inform All Employees
490. The Maze
679. 24 Game
1377. Frog Position After T Seconds
827. Making A Large Island

Backtracking

Classic ProblemsSimilar Problems
22. Generate Parentheses
78. Subsets90. Subsets II
39. Combination Sum40. Combination Sum II
46. Permutations77. Combinations
17. Letter Combinations of a Phone Number
491. Increasing Subsequences
1087. Brace Expansion1096. Brace Expansion II
489. Robot Room Cleaner
753. Cracking the Safe
1240. Tiling a Rectangle with the Fewest Squares

Dynamic Programming 1D

Classic ProblemsSimilar Problems
303. Range Sum Query – Immutable
53. Maximum Subarray
70. Climbing Stairs
198. House Robber
91. Decode Ways
139. Word Break140. Word Break II
300. Longest Increasing Subsequence
279. Perfect Squares
96. Unique Binary Search Trees95. Unique Binary Search Trees II
1048. Longest String Chain
338. Counting Bits
413. Arithmetic Slices
343. Integer Break
1186. Maximum Subarray Sum with One Deletion

Dynamic Programming 1D (Multiple States)

Classic ProblemsSimilar Problems
256. Paint House
309. Best Time to Buy and Sell Stock with Cooldown714. Best Time to Buy and Sell Stock with Transaction Fee
213. House Robber II
801. Minimum Swaps To Make Sequences Increasing
978. Longest Turbulent Subarray
790. Domino and Tromino Tiling
552. Student Attendance Record II

Dynamic Programming 2D (2D Input)

Classic ProblemsSimilar Problems
304. Range Sum Query 2D – Immutable
64. Minimum Path Sum
120. Triangle
62. Unique Paths63. Unique Paths II
85. Maximal Rectangle
312. Burst Balloons
410. Split Array Largest Sum
1074. Number of Submatrices That Sum to Target

Dynamic Programming 2D (Two 1D Inputs)

Classic ProblemsSimilar Problems
1143. Longest Common Subsequence115. Distinct Subsequences
712. Minimum ASCII Delete Sum for Two Strings
72. Edit Distance
10. Regular Expression Matching44. Wildcard Matching
97. Interleaving String

Dynamic Programming 2D (1D Input)

Classic ProblemsSimilar Problems
5. Longest Palindromic Substring516. Longest Palindromic Subsequence1312. Minimum Insertion Steps to Make a String Palindrome1216. Valid Palindrome III
1027. Longest Arithmetic Subsequence
877. Stone Game
873. Length of Longest Fibonacci Subsequence
1246. Palindrome Removal

Dynamic Programming 2D (1D Input + K)

Classic ProblemsSimilar Problems
265. Paint House II
123. Best Time to Buy and Sell Stock III188. Best Time to Buy and Sell Stock IV

Dynamic Programming (Knapsack)

Classic ProblemsSimilar Problems
322. Coin Change
377. Combination Sum IV
416. Partition Equal Subset Sum
474. Ones and Zeroes

Advanced Algorithms

Trie

Classic ProblemsSimilar Problems
720. Longest Word in Dictionary208. Implement Trie (Prefix Tree)211. Design Add and Search Words Data Structure642. Design Search Autocomplete System

Union Find

Classic ProblemsSimilar Problems
547. Friend Circles721. Accounts Merge323. Number of Connected Components in an Undirected Graph684. Redundant Connection
737. Sentence Similarity II924. Minimize Malware Spread

Topological Sort

Classic ProblemsSimilar Problems
207. Course Scheduley210. Course Schedule II802. Find Eventual Safe States269. Alien Dictionary

Boyer-Moore Voting Algorithm

Classic ProblemsSimilar Problems
169. Majority Element229. Majority Element II159. Longest Substring with At Most Two Distinct Characters1157. Online Majority Element In Subarray

Complex Problems

HashTable + Doubly Linked List

Classic ProblemsSimilar Problems
146. LRU Cache460. LFU Cache
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值