数据结构与算法学习(刷题)记录

题目 地址 标签
1.Tow Sum https://yutouwd.github.io/posts/2304652807 vector hashmap
2.Add Two Numbers https://yutouwd.github.io/posts/2010047615 list
3.Longest Substring without Repeating Characters https://yutouwd.github.io/posts/1224454559 hashmap 滑动窗口
5.Longest Palindromic Substring https://yutouwd.github.io/posts/3942687688 动态规划
7.Reverse Interger https://yutouwd.github.io/posts/1020379111 math
8.String to Integer https://yutouwd.github.io/posts/2689180698 string
9.Palindrome Number https://yutouwd.github.io/posts/837075 math
13.Roman to Integer https://yutouwd.github.io/posts/866377430 string
14.Longest Common Prefix https://yutouwd.github.io/posts/4084900668 string
17.Letter Combinations of a Phone Number https://yutouwd.github.io/posts/2133465870 回溯法
19.Remove Nth Node From End of List https://yutouwd.github.io/posts/1165746741 list
20.Valid Parentheses https://yutouwd.github.io/posts/4278894845 string
21.Merge Two Sorted Lists https://yutouwd.github.io/posts/2341614181 list
22.Generate Parentheses https://yutouwd.github.io/posts/2133465870 回溯法
26.Remove Duplicates from Sorted Array https://yutouwd.github.io/posts/3324950855 vector
27.Remove Element https://yutouwd.github.io/posts/2601079941 vector
28.Implement strStr() https://yutouwd.github.io/posts/2690412730 string
34.Find First and Last Position of Element in Sorted Array https://yutouwd.github.io/posts/932931314 二分查找
35.Search Insert Position https://yutouwd.github.io/posts/1764221558 vector 二分查找
36.Valid Sudoku https://yutouwd.github.io/posts/2138873447 vector
38.Count and Say https://yutouwd.github.io/posts/2107205244 math string
39.Combination Sum https://yutouwd.github.io/posts/2133465870 回溯法
40.Combination Sum II https://yutouwd.github.io/posts/2133465870 回溯法
46.Permutations https://yutouwd.github.io/posts/2133465870 回溯法
47.Permutations II https://yutouwd.github.io/posts/2133465870 回溯法
48.Rotate Image https://yutouwd.github.io/posts/1761982827 vector
49.Group Anagrams https://yutouwd.github.io/posts/3379987828 hashmap
50.Pow(x,n) https://yutouwd.github.io/posts/2356977837 math
53.Maximum Subarray https://yutouwd.github.io/posts/1411250823 math 分治法 动态规划
58.Length of Last Word https://yutouwd.github.io/posts/116524668 string
62.Unique Paths https://yutouwd.github.io/posts/1511993047 math 动态规划
63.Unique Paths II https://yutouwd.github.io/posts/1744891308 math 动态规划
64.Minimun Path Sum https://yutouwd.github.io/posts/3379915881 动态规划
66.Plus One https://yutouwd.github.io/posts/353015550 vector
70.Climbing Stairs https://yutouwd.github.io/posts/1665362949 math 分治法
72.Edit Distance https://yutouwd.github.io/posts/3404414355 动态规划
73.Set Matrix Zeros https://yutouwd.github.io/posts/2772617193 vector
74.Search a 2D Matrix https://yutouwd.github.io/posts/1125352499 二分查找
77.Combinations https://yutouwd.github.io/posts/1059005173 回溯法
78.Subsets https://yutouwd.github.io/posts/2133465870 回溯法
88.Merge Sorted Array https://yutouwd.github.io/posts/1685248582 vector
91.Decode Ways https::yutouwd.github.io/posts/4143396234 string 动态规划
94.Binary Tree Inorder Traversal https://yutouwd.github.io/posts/3359640998 tree
98.Validate Binary Search Tree https://yutouwd.github.io/posts/521402559 tree
101.Symmetic Tree https://yutouwd.github.io/posts/1627979900 tree
102.Binary Tree Level Order Traversal https://yutouwd.github.io/posts/3533375508 tree
103.Binary Tree Zigzag Level Order Traversal https://yutouwd.github.io/posts/2376334793 tree
104.Maximum Depth of Binary Tree https://yutouwd.github.io/posts/282883092 tree
107.Binary Tree Level Order Traversal II https://yutouwd.github.io/posts/4050777627 tree
108.Convert Sorted Array to Binary Search Tree https://yutouwd.github.io/posts/137445652 tree
112.Path Sum https:://yutouwd.github.io/posts/171992954 tree 深度优先 回溯法
113.Path Sum II https:://yutouwd.github.io/posts/171992954 tree 深度优先 回溯法
116.Populating Next Right Pointer in Each Node https://yutouwd.github.io/posts/3551767496 tree
118.Pascal Triangle https://yutouwd.github.io/posts/281994477 math
120.Triangle https://yutouwd.github.io/posts/3362500974 math 动态规划
121.Best Time to Buy and Sell Stock https://yutouwd.github.io/posts/3220033831 math
122.Best Time to Buy and Sell Stock II https://yutouwd.github.io/posts/473611493 math
123.Best Time to Buy and Sell Stock III https://yutouwd.github.io/posts/974687170 math 动态规划
125.Valid Palindrome https://yutouwd.github.io/posts/2448753357 string
130.Surrounded Regions https://yutouwd.github.io/posts/172704068 深度优先 广度优先
136.Single Number https://yutouwd.github.io/posts/1550415194 vector
141.Linked List Cycle https://yutouwd.github.io/posts/3103972891 list
142.Linked List Cycle II https://yutouwd.github.io/posts/3693154351 list
143.Reorder List https://yutouwd.github.io/posts/286346543 list
144.Binary Tree Preorder Traversal https://yutouwd.github.io/posts/3359640998 tree
145.Binary Tree Postorder Traversal https://yutouwd.github.io/posts/3359640998 tree
146.LRU Cache https://yutouwd.github.io/posts/426719232 design
155.Min Stack https://yutouwd.github.io/posts/2122295331 design stack
169.Majority Element https://yutouwd.github.io/posts/3720766983 分治法
188.Best Time to Buy and Sell Stock IV https://yutouwd.github.io/posts/1646362365 动态规划
189.Rotate Array https://yutouwd.github.io/posts/4112301143 vector
190.Reverse Bits https://yutouwd.github.io/posts/328681550 位操作
191.Number of 1 Bits https://yutouwd.github.io/posts/100215024 位操作
195.Tenth Line https://yutouwd.github.io/posts/633169037 bash
198.House Robber https://yutouwd.github.io/posts/2797751844 动态规划
200.Numbers of Island https://yutouwd.github.io/posts/1693659293 vector 深度优先
204.Count Primes https://yutouwd.github.io/posts/828591771 math
206.Reverse Linked List https://yutouwd.github.io/posts/2829474180 list
208.Implement Trie Prefix Tree https://yutouwd.github.io/posts/3444422637 string tree 前缀树
215.Kth Largest Element in an Array https://yutouwd.github.io/posts/2993655736 vector math
217.Contains Duplicate https://yutouwd.github.io/posts/679636703 vector
223.Rectangle Area https://yutouwd.github.io/posts/3099514846 math
225.Implement Stack Using Queue https://yutouwd.github.io/posts/619958913 design stack queue
226.Invert Binary Tree https://yutouwd.github.io/posts/3176726672 tree
231.Power of two https://yutouwd.github.io/posts/1808807184 位操作
234.Palindrome Linked List https://yutouwd.github.io/posts/3702077338 list
237.Delete Node in a List https://yutouwd.github.io/posts/3749239881 list
242.Valid Anagram https://yutouwd.github.io/posts/544546071 string hashmap
257.Binary Tree Path https://yutouwd.github.io/posts/2991780344 tree 深度优先
268.Missing Number https://yutouwd.github.io/posts/2942226103 math hashmap
278.First Bad Version https://yutouwd.github.io/posts/539789119 math 二分查找
283.Move Zeroes https://yutouwd.github.io/posts/2335896064 vector
290.Word Pattarn https://yutouwd.github.io/posts/1795481488 string
300.Longest Increasing Subsequence https://yutouwd.github.io/posts/2008457831 动态规划
309.Best Time to Buy and Sell Stock with Cooldown https://yutouwd.github.io/posts/4032611973 动态规划
316.Remove Duplicate Letters https://yutouwd.github.io/posts/1598960452 stack 单调栈
322.Coin Change https://yutouwd.github.io/posts/1072683465 动态规划
326.Power of Three https://yutouwd.github.io/posts/2084194376 math
328.Odd Even Linked List https://yutouwd.github.io/posts/1942160452 list
344.Reverse String https://yutouwd.github.io/posts/3640092658 string
349.Intersection of Two Arrays https://yutouwd.github.io/posts/1952106908 vector hashmap
350.Intersection of Two Arrays II https://yutouwd.github.io/posts/2444108763 vector hashmap
384.Shuffle an Array https://yutouwd.github.io/posts/2829300232 design
387.First Unique Character in a String https://yutouwd.github.io/posts/1245254830 string hashmap
402.Remove K Digits https://yutouwd.github.io/posts/1598960452 stack 单调栈
404.Sum of Left Leaves https://yutouwd.github.io/posts/3649739623 tree
409.Longest Palindrome https://yutouwd.github.io/posts/2988636715 string hashmap
412.Fizz Buzz https://yutouwd.github.io/posts/807358486 math
437.Path Sum III https:://yutouwd.github.io/posts/171992954 tree 深度优先 回溯法
441.Arraging Coins https://yutouwd.github.io/posts/2997814324 math
445.Add Two Numbers II https://yutouwd.github.io/posts/1819473222 list
461.Hamming Distance https://yutouwd.github.io/posts/890411703 位操作
496.Next Greater Element https://yutouwd.github.io/posts/1598960452 stack 单调栈
503.Next Greater Element II https://yutouwd.github.io/posts/1598960452 stack 单调栈
518.Coin Change II https://yutouwd.github.io/posts/1072683465 动态规划
583.Delete Operation for Two Strings https://yutouwd.github.io/posts/3404414355 动态规划
589.N-ary Tree Preorder Traversal https://yutouwd.github.io/posts/1370213866 tree
590.N-ary Tree Postorder Traversal https://yutouwd.github.io/posts/2778829074 tree
637.Average of Levels in Binary Tree https://yutouwd.github.io/posts/1794294162 tree
639.Decode Ways II https::yutouwd.github.io/posts/4143396234 string 动态规划
673.Number of Longest Increasing Subsequence https://yutouwd.github.io/posts/2008457831 动态规划
695.Max Area of Island https://yutouwd.github.io/posts/3305314244 广度优先
704.Binary Search https://yutouwd.github.io/posts/1944760669 二分查找
714.Best Time to Buy and Sell Stock with Transaction Fee https://yutouwd.github.io/posts/1342612877 动态规划
724.Find Pivot Number https://yutouwd.github.io/posts/2616520552 vector
733.Flood Fill https://yutouwd.github.io/posts/3305314244 广度优先
771.Jewels and Stones https://yutouwd.github.io/posts/2189086012 hashmap
820.Short Encoding of Words https://yutouwd.github.io/posts/3444422637 string tree 前缀树
824.Goat Latin https://yutouwd.github.io/posts/316802933 string
844.Backspace string compare https://yutouwd.github.io/posts/3938366888 string
876.Middle of the Linked List https://yutouwd.github.io/posts/2202627585 list
914.X of a Kind in a deck of Cards https://yutouwd.github.io/posts/4098248511 math hashmap
994.Rotting Oranges https://yutouwd.github.io/posts/1420042497 广度优先
1013.Partition Array into Three Parts with Equal Sum https://yutouwd.github.io/posts/1190621326 math vector
1018.Binary Prefix Divisble By 5 https://yutouwd.github.io/posts/2948955516 位操作
1020.Number of Enclaves https://yutouwd.github.io/posts/3587513103 深度优先
1103.Distribute Candies to People https://yutouwd.github.io/posts/839276500 math
1160.Find Words That Can Be Formed by Characters https://yutouwd.github.io/posts/3557020099 string

138/200

算法总结

  1. 回溯法
  2. 动态规划
  3. 排序算法
  4. 二分查找
  5. 前缀树
  6. 单调栈
  7. 二叉树的几种遍历

周赛

总结 排名 得分 完成时间 题目1 题目2 题目3 题目4
周赛261 1216/3367 7(2/4) 0:32:51 0:10:12 0:22:51 🐛2 0 0
周赛263 1123/4571 12(3/4) 0:44:54 0:08:09 🐛1 0:34:54 🐛1 0:20:22 0
周赛268 1437/4397 7(2/4) 0:12:57 0:04:19 0:12:57 0 0