LeetCode icon indicating copy to clipboard operation
LeetCode copied to clipboard

LeetCode 经典题目(JavaScript 实现)

LeetCode 经典题目(JavaScript 实现)

链表 (Linked List)

  • 19. Remove Nth Node From End of List
  • 21. Merge Two Sorted Lists
  • 23. Merge k Sorted Lists
  • 25. Reverse Nodes in k-Group
  • 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
  • 203. Remove Linked List Elements
  • 206. Reverse Linked List

栈与队列(Stack and Queue)

  • 20. Valid Parentheses
  • 32. Longest Valid Parentheses
  • 84. Largest Rectangle in Histogram
  • 225. Implement Stack using Queues
  • 232. Implement Queue using Stacks
  • 239. Sliding Window Maximum
  • 581. Shortest Unsorted Continuous Subarray
  • 739. Daily Temperatures

哈希表 (Hash Table)

  • 1. Two Sum
  • 15. 3Sum
  • 169. Majority Element

数组(Array)

  • 31. Next Permutation
  • 41. First Missing Positive
  • 54. Spiral Matrix
  • 189. Rotate Array

字符串(String)

  • 686. Repeated String Match
  • 1044. Longest Duplicate Substring

二分查找(Binary Search)

  • 4. Median of Two Sorted Arrays
  • 33. Search in Rotated Sorted Array
  • 34. Find First and Last Position of Element in Sorted Array
  • 35. Search Insert Position
  • 81. Search in Rotated Sorted Array II
  • 153. Find Minimum in Rotated Sorted Array
  • 154. Find Minimum in Rotated Sorted Array II
  • 378. Kth Smallest Element in a Sorted Matrix
  • 658. Find K Closest Elements
  • 704. Binary Search
  • 875. Koko Eating Bananas

排序(Sorting)

  • 215. Kth Largest Element in an Array
  • 315. Count of Smaller Numbers After Self
  • 912. Sort an Array

双指针(Two Pointers)

  • 11. Container With Most Water
  • 42. Trapping Rain Water
  • 75. Sort Colors
  • 283. Move Zeroes

滑动窗口(Sliding Window)

  • 3. Longest Substring Without Repeating Characters
  • 76. Minimum Window Substring
  • 209. Minimum Size Subarray Sum
  • 438. Find All Anagrams in a String
  • 713. Subarray Product Less Than K

二叉树(Binary Tree)

  • 94. Binary Tree Inorder Traversal
  • 98. Validate Binary Search Tree
  • 101. Symmetric Tree
  • 102. Binary Tree 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
  • 110. Balanced Binary Tree
  • 112. Path Sum
  • 124. Binary Tree Maximum Path Sum
  • 144. Binary Tree Preorder Traversal
  • 145. Binary Tree Postorder Traversal
  • 173. Binary Search Tree Iterator
  • 199. Binary Tree Right Side View
  • 222. Count Complete Tree Nodes
  • 226. Invert Binary Tree
  • 236. Lowest Common Ancestor of a Binary Tree
  • 297. Serialize and Deserialize Binary Tree
  • 450. Delete Node in a BST
  • 543. Diameter of Binary Tree

回溯(Backtracking)

  • 22. Generate Parentheses
  • 37. Sudoku Solver
  • 39. Combination Sum
  • 40. Combination Sum II
  • 46. Permutations
  • 47. Permutations II
  • 51. N-Queens
  • 78. Subsets
  • 79. Word Search
  • 90. Subsets II
  • 131. Palindrome Partitioning

贪心(Greedy)

  • 45. Jump Game II
  • 55. Jump Game
  • 56. Merge Intervals
  • 135. Candy
  • 376. Wiggle Subsequence
  • 402. Remove K Digits
  • 630. Course Schedule III
  • 763. Partition Labels

动态规划(Dynamic Programming)

  • 5. Longest Palindromic Substring
  • 10. Regular Expression Matching
  • 44. Wildcard Matching
  • 53. Maximum Subarray
  • 64. Minimum Path Sum
  • 70. Climbing Stairs
  • 72. Edit Distance
  • 96. Unique Binary Search Trees
  • 97. Interleaving String
  • 115. Distinct Subsequences
  • 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
  • 139. Word Break
  • 152. Maximum Product Subarray
  • 188. Best Time to Buy and Sell Stock IV
  • 198. House Robber
  • 213. House Robber II
  • 221. Maximal Square
  • 279. Perfect Squares
  • 300. Longest Increasing Subsequence
  • 309. Best Time to Buy and Sell Stock with Cooldown
  • 312. Burst Balloons
  • 322. Coin Change
  • 329. Longest Increasing Path in a Matrix
  • 337. House Robber III
  • 416. Partition Equal Subset Sum
  • 494. Target Sum
  • 516. Longest Palindromic Subsequence
  • 518. Coin Change 2
  • 714. Best Time to Buy and Sell Stock with Transaction Fee
  • 718. Maximum Length of Repeated Subarray
  • 879. Profitable Schemes
  • 887. Super Egg Drop
  • 913. Cat and Mouse
  • 918. Maximum Sum Circular Subarray
  • 968. Binary Tree Cameras
  • 1049. Last Stone Weight II
  • 1143. Longest Common Subsequence

并查集(Union Find)

  • 547. Number of Provinces

字典树(Trie)

  • 208. Implement Trie (Prefix Tree)
  • 211. Design Add and Search Words Data Structure
  • 440. K-th Smallest in Lexicographical Order
  • 677. Map Sum Pairs

线段树(Segment Tree)

  • 307. Range Sum Query - Mutable

图(Graph)

  • 785. Is Graph Bipartite?
  • 997. Find the Town Judge

深度优先搜索(Depth-First Search)

  • 200. Number of Islands

广度优先搜索(Breadth-First Search)

  • 407. Trapping Rain Water II
  • 542. 01 Matrix
  • 847. Shortest Path Visiting All Nodes
  • 994. Rotting Oranges

拓扑排序(Topological Sort)

  • 207. Course Schedule
  • 210. Course Schedule II

前缀和(Prefix Sum)

  • 437. Path Sum III
  • 560. Subarray Sum Equals K

设计(Design)

  • 146. LRU Cache
  • 155. Min Stack
  • 380. Insert Delete GetRandom O(1)
  • 460. LFU Cache