### LeetCode

Leetcode题解法，C++

0 已关注
117篇博文
• #### [Leetcode] 二叉树的遍历（#94，#144，#145 ）

本篇主要总结下二叉树的前序，中序，后序三种遍历算法的递归和迭代C++实现。三种遍历的题目可见Leetcode#94，#144，#145 。 1. 二叉树的结构和二叉树的建立（用于测试） #incl...

2017-02-09 12:21
230
• #### [Leetcode] #101 Symmetric Tree

Discription: Given a binary tree, check whether it is a mirror of itself (ie, symmetric around it...

2017-02-09 16:50
147
• #### [Leetcode] #104 Maximum Depth of Binary Tree

Discription: Given a binary tree, find its maximum depth. The maximum depth is the number of nod...

2017-02-09 19:37
169
• #### [Leetcode] #102 Binary Tree Level Order Traversal

Discription： Given a binary tree, return the level order traversal of its nodes' values. (ie, f...

2017-02-09 20:27
145
• #### [Leetcode] #108 Convert Sorted Array to Binary Search Tree

Discription: Given an array where elements are sorted in ascending order, convert it to a height bal...

2017-02-09 21:40
135
• #### [Leetcode] #96 Unique Binary Search Trees

Discription: Given n, how many structurally unique BST's (binary search trees) that store value...

2017-02-10 10:32
120
• #### [Leetcode] #112#113 Path Sum I & II

Path Sum I:Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that ad...

2017-02-10 15:27
155
• #### [Leetcode] #111 Minimum Depth of Binary Tree

Discription: Given a binary tree, find its minimum depth. The minimum depth is the number of nod...

2017-02-10 17:56
117
• #### [Leetcode] #114 Flatten Binary Tree to Linked List

Discription: Given a binary tree, flatten it to a linked list in-place. For example, Given ...

2017-02-10 19:25
120
• #### [Leetcode] #109 Convert Sorted List to Binary Search Tree

Discription: Given a singly linked list where elements are sorted in ascending order, convert it to...

2017-02-10 20:45
134
• #### [Leetcode] #129 Sum Root to Leaf Numbers

Discription：Given a binary tree containing digits from 0-9 only, each root-to-leaf path could repres...

2017-02-10 21:54
143
• #### [Leetcode] #160 Intersection of Two Linked Lists

Discription: Write a program to find the node at which the intersection of two singly linked li...

2017-02-11 09:44
254
• #### [Leetcode] #203 Remove Linked List Elements

Discription: Remove all elements from a linked list of integers that have value val. Example...

2017-02-11 10:24
130
• #### [Leetcode] #199 Binary Tree Right Side View

Discription: Given a binary tree, imagine yourself standing on the right side of it, return the...

2017-02-11 13:21
103
• #### [Leetcode] #147 Insertion Sort List

Discription: Sort a linked list using insertion sort. Solution: ListNode* insertionSortList(Lis...

2017-02-11 15:32
139
• #### [Leetcode] #153 Find Minimum in Rotated Sorted Array

DiscriptionSuppose an array sorted in ascending order is rotated at some pivot unknown to you before...

2017-02-11 16:23
127
• #### [Leetcode] #154 Find Minimum in Rotated Sorted Array II

DiscriptionFollow up for &quot;Find Minimum in Rotated Sorted Array&quot;:What if duplicates are all...

2017-02-11 17:05
163
• #### [Leetcode] #105 Construct Binary Tree from Preorder and Inorder Traversal

Discription: Given preorder and inorder traversal of a tree, construct the binary tree. Note...

2017-02-11 19:49
121
• #### [Leetcode] #141#142 Linked List Cycle I & II

Discription:Given a linked list, determine if it has a cycle in it.Solution:bool hasCycle(ListNode *...

2017-02-11 21:18
206
• #### [面试算法] 动态规划

LCS（最长公共子序列）int LCS(string s1, string s2){ int len1 = s1.size(), len2 = s2.size(); vector&amp;lt;v...

2017-04-12 15:29
170