前言
「 Leetcode 系列题解 」 (持续更新中,目前专注于剑指offer系列)
数据结构
下表总结了每题涉及的数据结构:
题目 | 数组 Array | 字符串 String | 链表 List | 栈 Stack | 二叉树 Tree | 哈希表HashMap | 集合 Set |
---|---|---|---|---|---|---|---|
11. Container With Most Water | √ | ||||||
70. Climbing Stairs | √ | √ | |||||
79. Word Search | √ | √ | |||||
105. Construct Binary Tree from Preorder and Inorder Traversal | √ | √ | √ | ||||
130. Surrounded Regions | √ | ||||||
153. Find Minimum in Rotated Sorted Array | √ | ||||||
154. Find Minimum in Rotated Sorted Array II | √ | ||||||
238. Product of Array Except Self | √ | ||||||
240. Search a 2D Matrix II | √ | ||||||
287. Find the Duplicate Number | √ | √ | |||||
509. Fibonacci Number | √ | √ | |||||
1143. Longest Common Subsequence | √ | √ | |||||
1559. Detect Cycles in 2D Grid |
算法
下表总结了每题涉及的算法:
题目 | 搜索算法 | 递归 | 循环检测 | 位运算 | 动态规划 |
---|---|---|---|---|---|
11. Container With Most Water | |||||
70. Climbing Stairs | √ | ||||
79. Word Search | DFS | √ | |||
105. Construct Binary Tree from Preorder and Inorder Traversal | √ | ||||
130. Surrounded Regions | BFS & DFS & Union Find | ||||
153. Find Minimum in Rotated Sorted Array | Binary Search | ||||
154. Find Minimum in Rotated Sorted Array II | Binary Search | ||||
238. Product of Array Except Self | |||||
240. Search a 2D Matrix II | Binary Search | √ | |||
287. Find the Duplicate Number | Binary Search | √ | √ | ||
509. Fibonacci Number | √ | ||||
1143. Longest Common Subsequence | √ | ||||
1559. Detect Cycles in 2D Grid | DFS & Union Find |