Skip to content

narutojian/Practice-Of-Algorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

Practice-Of-Algorithm

项目简介

此项目为保存算法练习记录的项目。

已完成的练习

算法平台 题目 本项目中解决该题的算法
leetcode 300. Longest Increasing Subsequence 1. 动态规划 2. 贪心+二分查找
leetcode 1160. Find Words That Can Be Formed by Characters 1. hash 计数 2. 数组计数
leetcode 695. Max Area of Island 1. dfs 2. bfs
leetcode 35. Search Insert Position 二分查找 while(left < right) 二分区间为(left,mid) (mid+1,right)
leetcode 34. Find First and Last Position of Element in Sorted Array 二分查找 查找模板
leetcode 538. Convert BST to Greater Tree 二叉树中序遍历
leetcode 39. Combination Sum 回溯+剪枝
leetcode 40. Combination Sum II 回溯+剪枝
leetcode 41. First Missing Positive 1. 哈希 2. 哈希+空间优化
leetcode 48. Rotate Image 数学归纳+空间优化
leetcode 86. Partition List 链表
leetcode 54. Spiral Matrix 模拟
leetcode 509. Fibonacci Number 动态规划,矩阵快速幂
leetcode 57. Insert Interval 模拟
leetcode 830. Positions of Large Groups 字符串遍历
leetcode 399. Evaluate Division 图 DFS
leetcode 547. Number of Provinces 图 DFS
leetcode 189. Rotate Array 数组循环右移
leetcode 121. Best Time to Buy and Sell Stock 暴力 动态规划 空间优化
leetcode 228. Summary Ranges 一次遍历 双指针
leetcode 1202. Smallest String With Swaps dfs+单调队列; 并查集+哈希+单调队列
leetcode 1018. Binary Prefix Divisible By 5 模拟+模运算
leetcode 1722. Minimize Hamming Distance After Swap Operations 并查集
leetcode 947. Most Stones Removed with Same Row or Column dfs; 并查集
leetcode 1232. Check If It Is a Straight Line 数学
leetcode 1726. Tuple with Same Product 哈希
leetcode 1727. Largest Submatrix With Rearrangements dp
leetcode 122. Best Time to Buy and Sell Stock II 贪心; dp
leetcode 628. Maximum Product of Three Numbers 排序+数学
leetcode 721. Accounts Merge 并查集+哈希
leetcode 989. Add to Array-Form of Integer 数学+双指针
leetcode 221. Maximal Square 暴力; dp
leetcode 1319. Number of Operations to Make Network Connected 并查集
leetcode 674. Longest Continuous Increasing Subsequence dp
leetcode 1128. Number of Equivalent Domino Pairs 哈希计数
leetcode 959. Regions Cut By Slashes 并查集
leetcode 1736. Latest Time by Replacing Hidden Digits 模拟
leetcode 560. Subarray Sum Equals K 前缀和+差分+哈希
leetcode 1737. Change Minimum Characters to Satisfy One of Three Conditions 前缀和+后缀和
leetcode 724. Find Pivot Index 前缀和
leetcode 1738. Find Kth Largest XOR Coordinate Value dp+优先队列
leetcode 1631. Path With Minimum Effort 二分+bfs;并查集;
leetcode 778. Swim in Rising Water 与上一题的思路一样
leetcode 888. Fair Candy Swap 哈希+数学
leetcode 839. Similar String Groups 并查集
leetcode 424. Longest Repeating Character Replacement 滑动窗口 双指针
leetcode 322. Coin Change 贪心+回溯;dp;BFS
leetcode 643. Maximum Average Subarray I 滑动窗口
leetcode 1208. Get Equal Substrings Within Budget 滑动窗口 双指针
leetcode 1742. Maximum Number of Balls in a Box 哈希计数
leetcode 1743. Restore the Array From Adjacent Pairs 图+dfs
leetcode 1423. Maximum Points You Can Obtain from Cards dfs;滑动窗口
leetcode 1745. Palindrome Partitioning IV dp
leetcode 567. Permutation in String 滑动窗口 哈希计数
leetcode 703. Kth Largest Element in a Stream 优先队列
leetcode 448. Find All Numbers Disappeared in an Array 哈希 计数
leetcode 485. Max Consecutive Ones 双指针
leetcode 566. Reshape the Matrix 二维数组映射一维数组
leetcode 1758. Minimum Changes To Make Alternating Binary String 数学 遍历
leetcode 1759. Count Number of Homogenous Substrings 滑动窗口
leetcode 1760. Minimum Limit of Balls in a Bag 二分查找
leetcode 704. Binary Search 二分查找
leetcode 1004. Max Consecutive Ones III 双指针; 前缀和+二分查找
leetcode 697. Degree of an Array 哈希表
leetcode 50. Pow(x, n) 二分查找 快速模幂
leetcode 766. Toeplitz Matrix 遍历
leetcode 74. Search a 2D Matrix 二分查找
leetcode 206. Reverse Linked List 递归;迭代
leetcode 1052. Grumpy Bookstore Owner 滑动窗口
leetcode 209. Minimum Size Subarray Sum 前缀和+二分查找;滑动窗口
leetcode 832. Flipping an Image 模拟遍历
leetcode 240. Search a 2D Matrix II 二分查找
leetcode 92. Reverse Linked List II 递归
leetcode 867. Transpose Matrix 遍历
leetcode 33. Search in Rotated Sorted Array 二分查找
leetcode 81. Search in Rotated Sorted Array II 二分查找
leetcode 896. Monotonic Array 遍历
leetcode 2. Add Two Numbers 递归
leetcode 29. Divide Two Integers 数学 递归
leetcode 303. Range Sum Query - Immutable 前缀和
leetcode 153. Find Minimum in Rotated Sorted Array 二分查找
leetcode 304. Range Sum Query 2D - Immutable 二维前缀和
leetcode 154. Find Minimum in Rotated Sorted Array II 二分查找
leetcode 338. Counting Bits 暴力; dp
leetcode 162. Find Peak Element 暴力; 二分
leetcode 1775. Equal Sum Arrays With Minimum Number of Operations 贪心
leetcode 232. Implement Queue using Stacks 双栈模拟队列
leetcode 503. Next Greater Element II 单调栈+循环数组
leetcode 131. Palindrome Partitioning dp+回溯
leetcode 1047. Remove All Adjacent Duplicates In String 栈 模拟
leetcode 1786. Number of Restricted Paths From First to Last Node dijkstra 记忆化搜索
leetcode 17. Letter Combinations of a Phone Number 回溯
leetcode 25. Reverse Nodes in k-Group 递归
leetcode 234. Palindrome Linked List 栈; 递归
leetcode 226. Invert Binary Tree 递归 前序遍历
leetcode 114. Flatten Binary Tree to Linked List 前序遍历 递归
leetcode 116. Populating Next Right Pointers in Each Node 递归
leetcode 654. Maximum Binary Tree 递归
leetcode 105. Construct Binary Tree from Preorder and Inorder Traversal 递归
leetcode 106. Construct Binary Tree from Inorder and Postorder Traversal 递归
leetcode 706. Design HashMap 哈希 链地址法
leetcode 705. Design HashSet 哈希 链地址法
leetcode 652. Find Duplicate Subtrees 递归 序列化
leetcode 230. Kth Smallest Element in a BST 递归
leetcode 1038. Binary Search Tree to Greater Sum Tree 递归
leetcode 98. Validate Binary Search Tree 递归
leetcode 700. Search in a Binary Search Tree 递归
leetcode 701. Insert into a Binary Search Tree 递归
leetcode 450. Delete Node in a BST 递归
leetcode 297. Serialize and Deserialize Binary Tree 递归 序列化 反序列化
leetcode 341. Flatten Nested List Iterator 递归
leetcode 72. Edit Distance dp;递归+备忘录
leetcode 53. Maximum Subarray dp;贪心
leetcode 1603. Design Parking System 模拟
leetcode 1143. Longest Common Subsequence dp
leetcode 583. Delete Operation for Two Strings dp
leetcode 712. Minimum ASCII Delete Sum for Two Strings dp
leetcode 516. Longest Palindromic Subsequence dp
leetcode 416. Partition Equal Subset Sum dp
leetcode 518. Coin Change 2 dp
leetcode 665. Non-decreasing Array 模拟
luogu P1466 [USACO2.2]集合 Subset Sums dp
leetcode 435. Non-overlapping Intervals 贪心; dp
leetcode 452. Minimum Number of Arrows to Burst Balloons 贪心
leetcode 55. Jump Game dp;贪心
leetcode 204. Count Primes 数学 埃氏筛
leetcode 45. Jump Game II dp
leetcode 51. N-Queens 回溯
leetcode 111. Minimum Depth of Binary Tree bfs;dfs
leetcode 139. Word Break dp
leetcode 752. Open the Lock bfs
leetcode 140. Word Break II dp
leetcode 494. Target Sum dp
leetcode 1006. Clumsy Factorial 模拟
leetcode 88. Merge Sorted Array 双指针
leetcode 781. Rabbits in Forest 贪心 数学
leetcode 80. Remove Duplicates from Sorted Array II 双指针
leetcode 26. Remove Duplicates from Sorted Array 双指针
leetcode 10. Regular Expression Matching dp 递归
leetcode 191. Number of 1 Bits 位运算
leetcode 231. Power of Two 位运算
leetcode 208. Implement Trie (Prefix Tree) 前缀树 字典树
leetcode 236. Lowest Common Ancestor of a Binary Tree 二叉树遍历 递归
leetcode 222. Count Complete Tree Nodes 递归
leetcode 130. Surrounded Regions 并查集
leetcode 990. Satisfiability of Equality Equations 并查集
leetcode 146. LRU Cache DS:LRU
leetcode 460. LFU Cache DS:LFU
leetcode 895. Maximum Frequency Stack 最大频率栈
leetcode 152. Maximum Product Subarray 暴力;dp
leetcode 97. Interleaving String dfs ; 递归
leetcode 198. House Robber dp
leetcode 5. Longest Palindromic Substring dp
leetcode 337. House Robber III dfs+记忆化
leetcode 279. Perfect Squares dp
leetcode 263. Ugly Number 递归
leetcode 264. Ugly Number II 暴力枚举
leetcode 309. Best Time to Buy and Sell Stock with Cooldown dp
leetcode 62. Unique Paths dp
leetcode 1. Two Sum 暴力枚举; hash
leetcode 3. Longest Substring Without Repeating Characters 双指针
leetcode 4. Median of Two Sorted Arrays 双指针
leetcode 6. ZigZag Conversion 数学
leetcode 7. Reverse Integer 数学
leetcode 9. Palindrome Number 数学
leetcode 11. Container With Most Water 暴力;双指针
leetcode 12. Integer to Roman 模拟
leetcode 13. Roman to Integer 模拟
leetcode 14. Longest Common Prefix 枚举
leetcode 15. 3Sum 暴力; 二分查找; 双指针
leetcode 16. 3Sum Closest 排序+双指针
leetcode 18. 4Sum 排序+双指针
leetcode 19. Remove Nth Node From End of List 快慢指针
leetcode 20. Valid Parentheses
leetcode 22. Generate Parentheses 回溯
leetcode 23. Merge k Sorted Lists 优先队列;分治
leetcode 24. Swap Nodes in Pairs 链表 迭代 递归
leetcode 27. Remove Element 双指针
leetcode 28. Implement strStr() 暴力匹配
leetcode 31. Next Permutation 下一个全排列
leetcode 46. Permutations 回溯
leetcode 47. Permutations II 回溯+剪枝
leetcode 63. Unique Paths II dp;滚动数组
leetcode 64. Minimum Path Sum dp; 滚动数组
leetcode 69. Sqrt(x) 二分查找; 牛顿迭代法
leetcode 70. Climbing Stairs dp 滚动数组

About

算法练习

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages