LeetCode 问题汇总(算法,难度,频率)

本文总结了LeetCode题库中经典算法题目及其难度级别、出现频率和主要涉及的数据结构与算法类型,帮助读者了解各类题目的特点及解决思路。


Id
Question
Difficulty
Frequency
Data Structures
Algorithms
1Two Sum25array + setsort + two pointers
2Add Two Numbers34linked listtwo pointers + math
3Longest Substring Without Repeating Characters32string + hashtabletwo pointers
4Median of Two Sorted Arrays53arraybinary search
5Longest Palindromic Substring42string 
6ZigZag Conversion31string 
7Reverse Integer23 math
8String to Integer (atoi)25stringmath
9Palindrome Number22 math
10Regular Expression Matching53stringrecursion + dp
11Container With Most Water32arraytwo pointers
12Integer to Roman34 math
13Roman to Integer24 math
14Longest Common Prefix21string 
153Sum35arraytwo pointers
163Sum Closest31arraytwo pointers
17Letter Combinations of a Phone Number33stringdfs
184Sum32array 
19Remove Nth Node From End of List23linked listtwo pointers
20Valid Parentheses25stringstack
21Merge Two Sorted Lists25linked listsort + two pointers + merge
22Generate Parentheses34stringdfs
23Merge k Sorted Lists34linked list + heapsort + two pointers + merge
24Swap Nodes in Pairs24linked list 
25Reverse Nodes in k-Group42linked listrecursion + two pointers
26Remove Duplicates from Sorted Array13arraytwo pointers
27Remove Element14arraytwo pointers
28Implement strStr()45stringtwo pointers + KMP + rolling hash
29Divide Two Integers43 binary search + math
30Substring with Concatenation of All Words31stringtwo pointers
31Next Permutation52arraypermutation
32Longest Valid Parentheses41stringdp
33Search in Rotated Sorted Array43arraybinary search
34Search for a Range43arraybinary search
35Search Insert Position22array 
36Valid Sudoku22array 
37Sudoku Solver42arraydfs
38Count and Say22stringtwo pointers
39Combination Sum33arraycombination
40Combination Sum II42arraycombination
41First Missing Positive52arraysort
42Trapping Rain Water42arraytwo pointers + stack
43Multiply Strings43stringtwo pointers + math
44Wildcard Matching53stringrecursion + dp + greedy
45Jump Game II42array 
46Permutations34arraypermutation
47Permutations II42arraypermutation
48Rotate Image42array 
49Anagrams34string + hashtable 
50Pow(x, n)35 binary search + math
51N-Queens43arraydfs
52N-Queens II43arraydfs
53Maximum Subarray33arraydp
54Spiral Matrix42array 
55Jump Game32array 
56Merge Intervals45array + linked list + red-black treesort + merge
57Insert Interval45array + linked list + red-black treesort + merge
58Length of Last Word11string 
59Spiral Matrix II32array 
60Permutation Sequence51 permutation + math
61Rotate List32linked listtwo pointers
62Unique Paths23arraydp
63Unique Paths II33arraydp
64Minimum Path Sum33arraydp
65Valid Number25stringmath
66Plus One12arraymath
67Add Binary24stringtwo pointers + math
68Text Justification42string 
69Sqrt(x)44 binary search
70Climbing Stairs25 dp
71Simplify Path31stringstack
72Edit Distance43stringdp
73Set Matrix Zeroes35array 
74Search a 2D Matrix33arraybinary search
75Sort Colors42arraysort + two pointers
76Minimum Window Substring42stringtwo pointers
77Combinations34 combination
78Subsets34arrayrecursion + combination
79Word Search34arraydfs
80Remove Duplicates from Sorted Array II22arraytwo pointers
81Search in Rotated Sorted Array II53arraybinary search
82Remove Duplicates from Sorted List II33linked listrecursion + two pointers
83Remove Duplicates from Sorted List13linked list 
84Largest Rectangle in Histogram52arraystack
85Maximal Rectangle51arraydp + stack
86Partition List33linked listtwo pointers
87Scramble String52stringrecursion + dp
88Merge Sorted Array25arraytwo pointers + merge
89Gray Code42 combination
90Subsets II42arrayrecursion + combination
91Decode Ways34stringrecursion + dp
92Reverse Linked List II32linked listtwo pointers
93Restore IP Addresses33stringdfs
94Binary Tree Inorder Traversal43tree + hashtablerecursion + morris + stack
95Unique Binary Search Trees II41treedp + dfs
96Unique Binary Search Trees31treedp
97Interleaving String52stringrecursion + dp
98Validate Binary Search Tree35treedfs
99Recover Binary Search Tree42treedfs
100Same Tree11treedfs
101Symmetric Tree12treedfs
102Binary Tree Level Order Traversal34treebfs
103Binary Tree Zigzag Level Order Traversal43queue + treebfs + stack
104Maximum Depth of Binary Tree11treedfs
105Construct Binary Tree from Preorder and Inorder Tr33array + treedfs
106Construct Binary Tree from Inorder and Postorder T33array + treedfs
107Binary Tree Level Order Traversal II31treebfs
108Convert Sorted Array to Binary Search Tree23treedfs
109Convert Sorted List to Binary Search Tree43linked listrecursion + two pointers
110Balanced Binary Tree12treedfs
111Minimum Depth of Binary Tree11treedfs
112Path Sum13treedfs
113Path Sum II22treedfs
114Flatten Binary Tree to Linked List33treerecursion + stack
115Distinct Subsequences42stringdp
116Populating Next Right Pointers in Each Node33treedfs
117Populating Next Right Pointers in Each Node II42treedfs
118Pascal's Triangle21array 
119Pascal's Triangle II21array 
120Triangle31arraydp
121Best Time to Buy and Sell Stock21arraydp
122Best Time to Buy and Sell Stock II31arraygreedy
123Best Time to Buy and Sell Stock III41arraydp
124Binary Tree Maximum Path Sum42treedfs
125Valid Palindrome25stringtwo pointers
126Word Ladder II11  
127Word Ladder35graphbfs + shortest path
128Longest Consecutive Sequence43array 
129Sum Root to Leaf Numbers24treedfs
130Surrounded Regions43arraybfs + dfs
131Palindrome Partitioning34stringdfs
132Palindrome Partitioning II43stringdp

原文地址http://wwwx.cs.unc.edu/~zhew/Leetcoder/

==============================================================================  我喜欢程序员,
他们单纯、固执、容易体会到成就感;
面对压力,能够挑灯夜战不眠不休;
面对困难,能够迎难而上挑战自我。
他们也会感到困惑与傍徨,
但每个程序员的心中都有一个比尔盖茨或是乔布斯的梦想“用智慧开创属于自己的事业”。
我想说的是,
其实我是一个程序员 ==============================================================================
【无人机】基于改进粒子群算法的无人机路径规划研究[和遗传算法、粒子群算法进行比较](Matlab代码实现)内容概要:本文围绕基于改进粒子群算法的无人机路径规划展开研究,重点探讨了在复杂环境中利用改进粒子群算法(PSO)实现无人机三维路径规划的方法,并将其与遗传算法(GA)、标准粒子群算法等传统优化算法进行对比分析。研究内容涵盖路径规划的多目标优化、避障策略、航路点约束以及算法收敛性和寻优能力的评估,所有实验均通过Matlab代码实现,提供了完整的仿真验证流程。文章还提到了多种智能优化算法在无人机路径规划中的应用比较,突出了改进PSO在收敛速度和全局寻优方面的优势。; 适合人群:具备一定Matlab编程基础和优化算法知识的研究生、科研人员及从事无人机路径规划、智能优化算法研究的相关技术人员。; 使用场景及目标:①用于无人机在复杂地形或动态环境下的三维路径规划仿真研究;②比较不同智能优化算法(如PSO、GA、蚁群算法、RRT等)在路径规划中的性能差异;③为多目标优化问题提供算法选型和改进思路。; 阅读建议:建议读者结合文中提供的Matlab代码进行实践操作,重点关注算法的参数设置、适应度函数设计及路径约束处理方式,同时可参考文中提到的多种算法对比思路,拓展到其他智能优化算法的研究与改进中。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值