LeetCode-Sword Finger Offer Topic Collection

Question number topic Solution link label Remarks Number of passes
03 Repeated numbers in the array [LeetCode-Sword Finger Offer] 03. Repeated numbers in the array Array, hash table
04 Lookup in a two-dimensional array [LeetCode] 240. Search two-dimensional matrix II (same sword refers to Offer 04) Array, double pointer
05 Replace spaces [LeetCode-Sword Finger Offer] 05. Replace spaces
06 Print linked list from end to beginning [LeetCode-Sword Finger Offer] 06. Print the linked list from end to beginning Linked list
07 Rebuild Binary Tree [LeetCode] 105. Construct a binary tree based on the pre-order traversal and middle-order traversal of a tree. (The same sword refers to Offer 07) Tree, recursion
09 Implement the queue with two stacks [LeetCode-Sword Finger Offer] 09. Use two stacks to implement queues Stack, design
10- I Fibonacci sequence 【LeetCode】10- I. Fibonacci Sequence Recursion
10- II Frog jumping problem 【LeetCode】70. Climbing stairs (same sword refers to Offer 10- II) Recursion
11 Rotate the smallest number of the array [LeetCode] 154. Find the minimum value II in the rotating sorted array (the same sword refers to Offer 11) Binary search
12 Path in the matrix 【LeetCode】79. Word search (same sword refers to Offer 12) DFS
13 Robot's range of motion [LeetCode-Sword Finger Offer] 13. The robot's range of motion
14- I Cut the rope [LeetCode] 343. Integer split (same as Offer 14- I && Offer 14- II) Mathematics, dynamic programming
14- II Cut the rope II [LeetCode] 343. Integer split (same as Offer 14- I && Offer 14- II) Mathematics, dynamic programming
15 Number of 1s in binary [LeetCode] 191. The number of bits 1 (same sword refers to Offer 15) Bit operation
16 Integer power 【LeetCode】50. Pow(x, n) (same: Sword refers to Offer 16) Recursion
17 Print from 1 to the largest n digits [LeetCode-Sword Finger Offer] Sword Finger Offer 17. Print from 1 to the largest n digits mathematics
18 Delete the node of the linked list [LeetCode-Sword Finger Offer] 18. Delete the node of the linked list Linked list
19 Regular expression matching [LeetCode] 10. Regular expression matching (same sword refers to Offer19) Dynamic programming, string, backtracking algorithm
20 A string representing a numeric value [LeetCode-Sword Finger Offer] 20. A string representing a numeric value mathematics
21 Adjust the order of the array so that the odd numbers come before the even numbers [LeetCode-Sword Finger Offer] 21. Adjust the array order so that odd numbers are in front of even numbers
22 The kth node from the bottom of the linked list [LeetCode-Sword Finger Offer] 22. The kth node from the bottom in the linked list Linked list, double pointer
24 Reverse linked list [LeetCode] 206. Reverse a singly linked list. (Same sword refers to Offer 24) Linked list
25 Merge two sorted linked lists [LeetCode] 21. Merge two ordered linked lists (the same sword refers to Offer 25) Divide and conquer algorithm, linked list
26 Tree substructure [LeetCode-Sword Finger Offer] 26. The substructure of the tree tree
27 Mirror of Binary Tree [LeetCode] 226. Flip the binary tree (same sword refers to Offer 27) tree
28 Symmetric binary tree [LeetCode] 101. Symmetric Binary Tree (Same sword refers to Offer 28) Tree, DFS, BFS
29 Print matrix clockwise 【LeetCode】54. Spiral matrix (same sword refers to Offer 29) Array
30 Stack containing min function [LeetCode] 155. Minimal stack (same sword refers to Offer 30) Stack, design
31 Stack push and pop sequence [LeetCode] 946. Verification stack sequence (same sword refers to Offer 31) Stack
32 - I Print binary tree from top to bottom [LeetCode-Sword Finger Offer] Sword Finger Offer 32-I. Print binary tree from top to bottom Tree, BFS
32 - II Print binary tree from top to bottom II [LeetCode] 102. Sequence traversal of binary tree (same sword refers to Offer 32-II) Tree, BFS
32 - III Print binary tree from top to bottom III [LeetCode-Sword Finger Offer] 32-III. Print binary tree from top to bottom III Tree, BFS
33 Post-order traversal sequence of binary search tree [LeetCode-Sword Finger Offer] 33. Post-order traversal sequence of binary search tree
34 A path whose sum is a certain value in a binary tree [LeetCode] 113. Path Sum II (The same sword refers to Offer 34) Tree, DFS
35 Replication of complex linked lists 【LeetCode】138. 复制带随机指针的链表(同 剑指 Offer 35) 链表、哈希表
36 二叉搜索树与双向链表 【LeetCode】426. 将二叉搜索树转化为排序的双向链表(剑指 Offer 36) 分治算法
37 序列化二叉树 【LeetCode】297. 二叉树的序列化与反序列化(同剑指Offer37) 树、设计
38 字符串的排列 【LeetCode-剑指Offer】38. 字符串的排列 回溯算法
39 数组中出现次数超过一半的数字 【LeetCode】169. 多数元素(同 剑指 Offer 39) 位运算、分治算法、数组
40 最小的k个数 【LeetCode-剑指Offer】40. 最小的k个数 堆、分治算法
41 数据流中的中位数 【LeetCode】295. 数据流的中位数(同剑指Offer41) 堆、设计
42 连续子数组的最大和 【LeetCode】53. 最大子序和(同剑指 Offer 42) 数组、分治算法、动态规划
43 1~n 整数中 1 出现的次数 【LeetCode】233. 数字 1 的个数(同剑指Offer43) 数学
44 数字序列中某一位的数字 【LeetCode】400. 第N个数字(同剑指 Offer 44) 数学
45 把数组排成最小的数 【LeetCode-剑指Offer】45. 把数组排成最小的数 排序
46 把数字翻译成字符串 【LeetCod-剑指Offer】46. 把数字翻译成字符串
47 礼物的最大价值 【LeetCode-剑指Offer】47. 礼物的最大价值 动态规划
48 最长不含重复字符的子字符串 【LeetCode】3. 无重复字符的最长子串(同剑指 Offer 48) 哈希表、双指针、Sliding Window、字符串
49 丑数 【LeetCode】264. 丑数 II(同剑指 Offer 49) 数学、堆、动态规划
50 第一个只出现一次的字符 【LeetCode-剑指Offer】50. 第一个只出现一次的字符 哈希表
51 数组中的逆序对 【LeetCode-剑指Offer】51. 数组中的逆序对 归并
52 两个链表的第一个公共节点 【LeetCode】160. 相交链表(同剑指 Offer 52) 链表
53 - I 在排序数组中查找数字 I 【LeetCode】34. 在排序数组中查找元素的第一个和最后一个位置(同剑指 Offer 53 - I) 数组、二分查找
53 - II 0~n-1中缺失的数字 【LeetCode-剑指Offer】53 - II. 0~n-1中缺失的数字 数组、二分查找
54 二叉搜索树的第k大节点 【LeetCode-剑指Offer】54. 二叉搜索树的第k大节点
55 - I 二叉树的深度 【LeetCode】104. 二叉树的最大深度(同剑指 Offer 55 - I) 树、DFS、递归
55 - II 平衡二叉树 【LeetCode】110. 平衡二叉树(同剑指 Offer 55 - II) 树、DFS
56 - I 数组中数字出现的次数 【LeetCode-剑指Offer】56 - I. 数组中数字出现的次数
56 - II 数组中数字出现的次数 II 【LeetCode-剑指Offer】剑指 Offer 56 - II. 数组中数字出现的次数 II
57 和为s的两个数字 【LeetCode】1. 两数之和(基本同剑指 Offer 57) 数组、哈希表
57 - II 和为s的连续正数序列 【LeetCode-剑指Offer】57 - II. 和为s的连续正数序列
58 - I 翻转单词顺序 【LeetCode】151. 翻转字符串里的单词(同剑指 Offer 58 - I) 字符串
58 - II 左旋转字符串 【LeetCode-剑指Offer】58 - II. 左旋转字符串 字符串
59 - I 滑动窗口的最大值 【LeetCode】239、滑动窗口最大值(同剑指 Offer 59 - I) 队列、Sliding Window
59 - II 队列的最大值 【LeetCode-剑指Offer】59 - II. 队列的最大值 队列、Sliding Window
60 n个骰子的点数 【LeetCode-剑指Offer】60. n个骰子的点数
61 扑克牌中的顺子 【LeetCode-剑指Offer】61. 扑克牌中的顺子
62 圆圈中最后剩下的数字 【LeetCode-剑指Offer】62. 圆圈中最后剩下的数字
63 股票的最大利润 【LeetCode】121. 买卖股票的最佳时机(剑指 Offer 63) 动态规划
64 求1+2+…+n 【LeetCode-剑指Offer】64. 求1+2+…+n
65 不用加减乘除做加法 【LeetCode-剑指Offer】65. 不用加减乘除做加法
66 构建乘积数组 【LeetCode-剑指Offer】66. 构建乘积数组
67 把字符串转换成整数 【LeetCode】8. 字符串转换整数 (atoi)(同剑指 Offer 67) 数学、字符串
68 - I 二叉搜索树的最近公共祖先 【LeetCode】235. 二叉搜索树的最近公共祖先(同剑指 Offer 68 - I)
68 - II 二叉树的最近公共祖先 【LeetCode】236. 二叉树的最近公共祖先(同剑指 Offer 68 - II)

Guess you like

Origin blog.csdn.net/HeavenDan/article/details/111460584