leetcode分类题解

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Irving_zhang/article/details/78835035

leetcode的题解专栏多如牛毛,但很少有系统的全面的专栏。在专栏里,按照如下的分类方式进行刷题,从暴力解->优化解->最优解三个层次来分析题目,希望能够帮助到找工作的你。

数组

1、Two Sum
4、Median of Two Sorted Arrays
Remove Duplicates from Sorted Array
Remove Duplicates from Sorted Array II
Search in Rotated Sorted Array
Search in Rotated Sorted Array II
Longest Consecutive Sequence
3Sum
3Sum Closest
4Sum
Remove Element
Next Permutation
Permutation Sequence
Valid Sudoku
Trapping Rain Water
Rotate Image
Plus One
Climbing Stairs
Gray Code
Set Matrix Zeroes
Gas Station
Candy
Single Number
Single Number II

链表

2、Add Two Numbers
Reverse Linked List II
Partition List
Remove Duplicates from Sorted List
Remove Duplicates from Sorted List II
Rotate List
Remove Nth Node From End of List
Swap Nodes in Pairs
Reverse Nodes in k-Group
Copy List with Random Pointer
Linked List Cycle
Linked List Cycle II
Reorder List
LRU Cache

字符串

3、Longest Substring Without Repeating Characters
5、Longest Palindromic Substring
10、Regular Expression Matching
Valid Palindrome
Implement strStr()
String to Integer (atoi)
Add Binary
Wildcard Matching
Longest Common Prefix
Valid Number
Integer to Roman
Roman to Integer
Count and Say
Anagrams
Simplify Path
Length of Last Word

Valid Parentheses
Longest Valid Parentheses
Largest Rectangle in Histogram
Evaluate Reverse Polish Notation

二叉树

Binary Tree Preorder Traversal
Binary Tree Inorder Traversal
Binary Tree Postorder Traversal
Binary Tree Level Order Traversal
Binary Tree Level Order Traversal II
Binary Tree Zigzag Level Order Traversal Recover Binary Search Tree
Same Tree
Symmetric Tree
Balanced Binary Tree
Flatten Binary Tree to Linked List
Populating Next Right Pointers in Each Node II
Construct Binary Tree from Preorder and Inorder Traversal
Construct Binary Tree from Inorder and Postorder Traversal
Unique Binary Search Trees
Unique Binary Search Trees II
Validate Binary Search Tree
Convert Sorted Array to Binary Search Tree
Convert Sorted List to Binary Search Tree
Minimum Depth of Binary Tree
Maximum Depth of Binary Tree
Path Sum
Path Sum II
Binary Tree Maximum Path Sum
Populating Next Right Pointers in Each Node
Sum Root to Leaf Numbers

排序

Merge Sorted Array
Merge Two Sorted Lists
Merge k Sorted Lists
Insertion Sort List
Sort List
First Missing Positive
Sort Colors

查找

Search for a Range
Search Insert Position
Search a 2D Matrix

暴力枚举

Subsets
Subsets II
Permutations
Permutations II
Combinations
Letter Combinations of a Phone Number

BFS

Word Ladder
Word Ladder II
Surrounded Regions
BFS小结

DFS

Palindrome Partitioning
Unique Paths
Unique Paths II
N-Queens
N-Queens II
Restore IP Addresses Combination Sum
Combination Sum II
Generate Parentheses
Sudoku Solver
Word Search

分治

Pow(x, n)
Sqrt(x)

贪心

Jump Game
Jump Game II
Best Time to Buy and Sell Stock
Best Time to Buy and Sell Stock II
Longest Substring Without Repeating Characters
Container With Most Water

动态规划

Triangle
Maximum Subarray
Palindrome Partitioning II
Maximal Rectangle
Best Time to Buy and Sell Stock III
Interleaving String
Scramble String
Minimum Path Sum
Edit Distance
Decode Ways Distinct Subsequences
Word Break
Word Break II

Clone Graph

模拟

7、Reverse Integer
Palindrome Number
Insert Interval
Merge Intervals
Minimum Window Substring Multiply Strings
Substring with Concatenation of All Words
Pascal’s Triangle
Pascal’s Triangle II Spiral Matrix
Spiral Matrix II
ZigZag Conversion
Divide Two Integers
Text Justification
Max Points on a Line

猜你喜欢

转载自blog.csdn.net/Irving_zhang/article/details/78835035