leetcode解题目录

参考文献:http://blog.csdn.net/lanxu_yy/article/details/17848219 不过本文准备用超链接的方式连接到相应解答页面,不断更新中

题目 算法 数据结构 注意事项
Clone Graph BFS 哈希表
Word Ladder II BFS 哈希表
Surrounded Regions BFS 矩阵
Word Ladder BFS N/A
Binary Tree Level Order Traversal BFS|前序遍历 队列
Binary Tree Level Order Traversal II BFS|前序遍历 队列
Binary Tree Zigzag Level Order Traversal  BFS|前序遍历 队列 每一层顺序分别对待
Implement strStr() KMP算法 N/A
Copy List with Random Pointer N/A 哈希表
Remove Duplicates from Sorted Array N/A 哈希表
Remove Duplicates from Sorted Array II N/A 哈希表
Set Matrix Zeroes N/A 哈希表
Anagrams N/A 哈希表
First Missing Positive N/A 哈希表
Two Sum N/A 哈希表
Evaluate Reverse Polish Notation N/A 堆栈
Largest Rectangle in Histogram N/A 堆栈 记录重要位置
Minimum Window Substring N/A 堆栈
Simplify Path N/A 堆栈
Longest Valid Parentheses N/A 堆栈
Valid Parentheses N/A 堆栈 词法分析
Container With Most Water N/A 堆栈 记录重要位置
Best Time to Buy and Sell Stock N/A 数组
Best Time to Buy and Sell Stock II N/A 数组
Best Time to Buy and Sell Stock III N/A 数组
Length of Last Word N/A 数组
Search Insert Position N/A 数组
Search for a Range N/A 数组
Spiral Matrix N/A 矩阵 简化为子问题
Spiral Matrix II N/A 矩阵 简化为子问题
LRU Cache N/A 链表
Reorder List N/A 链表 快慢指针&链表倒序
Linked List Cycle N/A 链表 快慢指针
Linked List Cycle II N/A 链表 快慢指针
Reverse Linked List II N/A 链表
Partition List N/A 链表
Remove Duplicates from Sorted List N/A 链表
Remove Duplicates from Sorted List II N/A 链表
Merge Two Sorted Lists N/A 链表
Rotate List N/A 链表 快慢指针
Reverse Nodes in k-Group N/A 链表
Swap Nodes in Pairs N/A 链表
Remove Nth Node From End of List N/A 链表 快慢指针
Text Justification N/A 队列
Candy N/A N/A 简化为子问题
Valid Palindrome N/A N/A 首尾指针
Plus One N/A N/A 模拟加法运算
Valid Number N/A N/A 词法分析
Add Binary N/A N/A 模拟加法运算
Insert Interval N/A N/A
Merge Intervals N/A N/A
Multiply Strings N/A N/A 模拟乘法运算
Trapping Rain Water N/A N/A
Valid Sudoku N/A N/A
Roman to Integer N/A N/A
Integer to Roman N/A N/A
Palindrome Number N/A N/A
Reverse Integer N/A N/A
ZigZag Conversion N/A N/A
Add Two Numbers N/A N/A 模拟加法运算
Median of Two Sorted Arrays N/A N/A
String to Integer (atoi) STL函数 N/A
Next Permutation STL经典算法 N/A
Recover Binary Search Tree 中序遍历 二叉树
3Sum 二分查找 N/A
3Sum Closest 二分查找 N/A
4Sum 二分查找 N/A
Single Number 位运算 N/A
Single Number II 位运算 N/A
Construct Binary Tree from Preorder and Inorder Traversal 前序中序遍历 N/A
Binary Tree Preorder Traversal 前序遍历 二叉树
Flatten Binary Tree to Linked List 前序遍历 二叉树
Interleaving String 动态规划 二叉树
Unique Binary Search Trees 动态规划 二叉树
Word Break 动态规划 N/A
Word Break II 动态规划 N/A
Palindrome Partitioning 动态规划 N/A
Palindrome Partitioning II 动态规划 N/A
Triangle 动态规划 N/A
Distinct Subsequences 动态规划 N/A
Decode Ways 动态规划 N/A
Scramble String 动态规划 N/A
Maximal Rectangle 动态规划 N/A
Edit Distance 动态规划 N/A
Climbing Stairs 动态规划 N/A
Minimum Path Sum 动态规划 N/A
Unique Paths 动态规划 N/A
Unique Paths II 动态规划 N/A
Jump Game 动态规划 N/A
Jump Game II 动态规划 N/A
Maximum Subarray 动态规划 N/A
Wildcard Matching 动态规划 N/A
Substring with Concatenation of All Words 动态规划 N/A
Sort List 合并排序 链表 快慢指针
Merge Sorted Array 合并排序 N/A
Construct Binary Tree from Inorder and Postorder Traversal 后序中序遍历 N/A
Binary Tree Postorder Traversal 后续遍历 二叉树
Combinations 回溯 N/A
Permutation Sequence 回溯 N/A
N-Queens 回溯 N/A
N-Queens II 回溯 N/A
Permutations 回溯 N/A
Permutations II 回溯 N/A
Combination Sum 回溯 N/A
Combination Sum II 回溯 N/A
Sudoku Solver 回溯 N/A
Longest Substring Without Repeating Characters 回溯 N/A
Max Points on a Line 循环遍历 N/A 排除相同的点
Longest Common Prefix 循环遍历 N/A
Longest Palindromic Substring 循环遍历 N/A
Insertion Sort List 插入排序 链表
Rotate Image 矢量旋转与平移 N/A
Longest Consecutive Sequence 类BFS 哈希表
Search in Rotated Sorted Array 类二分查找 N/A
Search in Rotated Sorted Array II 类二分查找 N/A 特殊考虑相等数据
Sqrt(x) 类二分查找 N/A
Pow(x, n) 类二进制 N/A
Divide Two Integers 类二进制 N/A
Gas Station 类合并排序 N/A
Merge k Sorted Lists 类外排序 N/A
Sort Colors 类快速排序 N/A
Remove Element 类快速排序 N/A
Search a 2D Matrix 类杨氏矩阵 N/A
Restore IP Addresses 背包问题 N/A
Sum 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/A
Pascal‘s Triangle II 递归 N/A
Convert Sorted List to Binary Search Tree 递归 N/A 快慢指针&反中序遍历
Convert Sorted Array to Binary Search Tree 递归 N/A 反中序遍历
Subsets 递归 N/A
Subsets II 递归 N/A
Gray Code 递归 N/A
Word Search 递归 N/A
Count and Say 递归 N/A
Generate Parentheses 递归 N/A
Letter Combinations of a Phone Number 递归 N/A
Regular Expression Matching 递归 N/A

leetcode解题目录

时间: 2024-08-11 03:29:04

leetcode解题目录的相关文章

leetCode解题报告5道题(十)

Disk Schedule Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 2368    Accepted Submission(s): 333 Problem Description 有很多从磁盘读取数据的需求,包括顺序读取.随机读取.为了提高效率,需要人为安排磁盘读取.然而,在现实中,这种做法很复杂.我们考虑一个相对简单的场景.磁

leetCode解题报告5道题(九)

题目一:Combinations Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. For example,If n = 4 and k = 2, a solution is: [ [2,4], [3,4], [2,3], [1,2], [1,3], [1,4], ] 分析: 题意给我们一个数字n, 和一个数字k,让我们求出从 1~~n中取出k个数所能得到的组合数 所

leetCode解题报告5道题(十一)

题目一:Subsets Given a set of distinct integers, S, return all possible subsets. Note: Elements in a subset must be in non-descending order. The solution set must not contain duplicate subsets. For example, If S = [1,2,3], a solution is: [ [3], [1], [2]

LeetCode解题源代码链接集锦二

15.Sort List--链表在O(nlogn),常数空间内完成排序 关键点:中间分裂链表,采用双指针归并排序     中间分裂链表的方法:快慢指针,快指针走两步,这样就可以找到中间的了 C++:http://blog.csdn.net/jiadebin890724/article/details/21334059 Java:http://blog.csdn.net/worldwindjp/article/details/18986737 LeetCode解题源代码链接集锦二,布布扣,bubu

LeetCode解题报告:LRU Cache

LRU Cache Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and set. get(key) - Get the value (will always be positive) of the key if the key exists in the cache, otherwise retu

leetCode解题报告5道题(六)

题目一: Longest Substring Without Repeating Characters Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the

leetCode解题报告5道题(八)

题目一: Populating Next Right Pointers in Each Node Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; } Populate each next pointer to point to its next right node. If there is no next right node, the

leetCode解题报告5道题(七)

先送上亚马逊传送门:<黑客与画家>:硅谷创业之父 Paul Graham 文集 再送上一个思维导图: 最好的办法就是自己创业或者加入创业公司 一个命题 命题 创业是一个压缩的过程,所有工作压缩成短短几年. 你不再是低强度的工作四十年,而是以极限强度工作四年 举例解释 一个优秀的黑客去除各种障碍,工作效率可以是在公司时的36倍. 假设他年薪8万美元,那么一个勤奋工作,摆脱杂事干扰的聪明黑客, 他的工作相当于年薪200万美元的价值 这里说的是极限情况,休闲时间为0,工作强度足以危害到健康. 守恒定

LeetCode解题报告:Reorder List

Reorder List Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do this in-place without altering the nodes' values. For example,Given {1,2,3,4}, reorder it to {1,4,2,3}. 思路: 1.利用快慢两个指针将链表一分为二: 2.针对第二个子链表求倒序