LeetCode总结

来源:互联网 发布:网络劫持修复工具 编辑:程序博客网 时间:2024/04/29 09:59

转自:http://blog.csdn.net/lanxu_yy/article/details/17848219

万分感谢原作者 

最近完成了www.leetcode.com的online judge中151道算法题目。除各个题目有特殊巧妙的解法以外,大部分题目都是经典的算法或者数据结构,因此做了如下小结,具体的解题思路可以搜索我的博客LeetCode题解

题目算法数据结构注意事项Clone GraphBFS哈希表Word Ladder IIBFS哈希表Surrounded RegionsBFS矩阵Word LadderBFSN/ABinary Tree Level Order TraversalBFS|前序遍历队列Binary Tree Level Order Traversal IIBFS|前序遍历队列Binary Tree Zigzag Level Order Traversal BFS|前序遍历队列每一层顺序分别对待Implement strStr()KMP算法N/ACopy List with Random PointerN/A哈希表Remove Duplicates from Sorted ArrayN/A哈希表Remove Duplicates from Sorted Array IIN/A哈希表Set Matrix ZeroesN/A哈希表AnagramsN/A哈希表First Missing PositiveN/A哈希表Two SumN/A哈希表Evaluate Reverse Polish NotationN/A堆栈Largest Rectangle in HistogramN/A堆栈记录重要位置Minimum Window SubstringN/A堆栈Simplify PathN/A堆栈Longest Valid ParenthesesN/A堆栈Valid ParenthesesN/A堆栈词法分析Container With Most WaterN/A堆栈记录重要位置Reverse Words in a StringN/A堆栈翻转字符串Best Time to Buy and Sell StockN/A数组Best Time to Buy and Sell Stock IIN/A数组Best Time to Buy and Sell Stock IIIN/A数组Length of Last WordN/A数组Search Insert PositionN/A数组Search for a RangeN/A数组Spiral MatrixN/A矩阵简化为子问题Spiral Matrix IIN/A矩阵简化为子问题LRU CacheN/A链表Reorder ListN/A链表快慢指针&链表倒序Linked List CycleN/A链表快慢指针Linked List Cycle IIN/A链表快慢指针Reverse Linked List IIN/A链表Partition ListN/A链表Remove Duplicates from Sorted ListN/A链表Remove Duplicates from Sorted List IIN/A链表Merge Two Sorted ListsN/A链表Rotate ListN/A链表快慢指针Reverse Nodes in k-GroupN/A链表Swap Nodes in PairsN/A链表Remove Nth Node From End of ListN/A链表快慢指针Text JustificationN/A队列CandyN/AN/A简化为子问题Valid PalindromeN/AN/A首尾指针Plus OneN/AN/A模拟加法运算Valid NumberN/AN/A词法分析Add BinaryN/AN/A模拟加法运算Insert IntervalN/AN/AMerge IntervalsN/AN/AMultiply StringsN/AN/A模拟乘法运算Trapping Rain WaterN/AN/AValid SudokuN/AN/ARoman to IntegerN/AN/AInteger to RomanN/AN/APalindrome NumberN/AN/AReverse IntegerN/AN/AZigZag ConversionN/AN/AAdd Two NumbersN/AN/A模拟加法运算Median of Two Sorted ArraysN/AN/AString to Integer (atoi)STL函数N/ANext PermutationSTL经典算法N/ARecover Binary Search Tree中序遍历二叉树3Sum二分查找N/A3Sum Closest二分查找N/A4Sum二分查找N/ASingle Number位运算N/ASingle Number II位运算N/AConstruct Binary Tree from Preorder and Inorder Traversal前序中序遍历N/ABinary Tree Preorder Traversal前序遍历二叉树Flatten Binary Tree to Linked List前序遍历二叉树Interleaving String动态规划二叉树Unique Binary Search Trees动态规划二叉树Word Break动态规划N/AWord Break II动态规划N/APalindrome Partitioning动态规划N/APalindrome Partitioning II动态规划N/ATriangle动态规划N/ADistinct Subsequences动态规划N/ADecode Ways动态规划N/AScramble String动态规划N/AMaximal Rectangle动态规划N/AEdit Distance动态规划N/AClimbing Stairs动态规划N/AMinimum Path Sum动态规划N/AUnique Paths动态规划N/AUnique Paths II动态规划N/AJump Game动态规划N/AJump Game II动态规划N/AMaximum Subarray动态规划N/AWildcard Matching动态规划N/ASubstring with Concatenation of All Words动态规划N/ASort List合并排序链表快慢指针Merge Sorted Array合并排序N/AConstruct Binary Tree from Inorder and Postorder Traversal后序中序遍历N/ABinary Tree Postorder Traversal后续遍历二叉树Combinations回溯N/APermutation Sequence回溯N/AN-Queens回溯N/AN-Queens II回溯N/APermutations回溯N/APermutations II回溯N/ACombination Sum回溯N/ACombination Sum II回溯N/ASudoku Solver回溯N/ALongest Substring Without Repeating Characters回溯N/AMax Points on a Line循环遍历N/A排除相同的点Longest Common Prefix循环遍历N/ALongest Palindromic Substring循环遍历N/AInsertion Sort List插入排序链表Rotate Image矢量旋转与平移N/ALongest Consecutive Sequence类BFS哈希表Search in Rotated Sorted Array类二分查找N/ASearch in Rotated Sorted Array II类二分查找N/A特殊考虑相等数据Sqrt(x)类二分查找N/APow(x, n)类二进制N/ADivide Two Integers类二进制N/AGas Station类合并排序N/AMerge k Sorted Lists类外排序N/ASort Colors类快速排序N/ARemove Element类快速排序N/ASearch a 2D Matrix类杨氏矩阵N/ARestore IP Addresses背包问题N/ASum Root to Leaf Numbers递归二叉树Binary Tree Maximum Path Sum递归二叉树opulating Next Right Pointers in Each Node递归二叉树Populating Next Right Pointers in Each Node II递归二叉树Path Sum递归二叉树Path Sum II递归二叉树Maximum Depth of Binary Tree 递归二叉树Minimum Depth of Binary Tree递归二叉树Balanced Binary Tree递归二叉树Symmetric Tree递归二叉树Same Tree 递归二叉树Validate Binary Search Tree递归二叉树Unique Binary Search Trees II递归二叉树Binary Tree Inorder Traversal递归二叉树Pascal's Triangle递归N/APascal's Triangle II递归N/AConvert Sorted List to Binary Search Tree递归N/A快慢指针&反中序遍历Convert Sorted Array to Binary Search Tree递归N/A反中序遍历Subsets递归N/ASubsets II递归N/AGray Code递归N/AWord Search递归N/ACount and Say递归N/AGenerate Parentheses递归N/ALetter Combinations of a Phone Number递归N/ARegular Expression Matching递归N/A
0 0
原创粉丝点击