### Tree

0 已关注
35篇博文
• #### 树相关算法

判断二叉树的后序遍历序列多叉树的构建二叉树中和为某一值的路径树的子结构对称的二叉树208. Implement Trie (Prefix Tree)根据先序遍历和中序遍历构建二叉树Tree Mirro...

6天前 21:35
11
• #### 二叉树中和为某一值的路径

输入一颗二叉树和一个整数，打印出二叉树中结点值的和为输入整数的所有路径。路径定义为从树的根结点开始往下一直到叶结点所经过的结点形成一条路径。void findPath(BinaryTreeNode* ...

5天前 08:39
14
• #### 208. Implement Trie (Prefix Tree)

Implement a trie with insert, search, and startsWith methods.Note:You may assume that all inputs are...

6天前 08:19
16
• #### 450. Delete Node in a BST

Given a root node reference of a BST and a key, delete the node with the given key in the BST. Retur...

2018-01-24 08:25
45
• #### 101. Symmetric Tree

Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For ...

2018-01-29 08:17
34
• #### 404. Sum of Left Leaves

Find the sum of all left leaves in a given binary tree. Example: 3 / \ 9 20 / \ ...

2018-01-30 08:40
35
• #### 606. Construct String from Binary Tree

You need to construct a string consists of parenthesis and integers from a binary tree with the preo...

2018-01-30 08:53
42
• #### 652. Find Duplicate Subtrees

Given a binary tree, return all duplicate subtrees. For each kind of duplicate subtrees, you only ne...

2018-01-31 08:23
41
• #### 449. Serialize and Deserialize BST

Serialization is the process of converting a data structure or object into a sequence of bits so tha...

2018-01-31 08:57
61
• #### 310. Minimum Height Trees

For a undirected graph with tree characteristics, we can choose any node as the root. The result gra...

2018-02-01 09:10
56
• #### 230. Kth Smallest Element in a BST

Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. ...

2018-02-02 08:49
35
• #### 671. Second Minimum Node In a Binary Tree

Given a non-empty special binary tree consisting of nodes with the non-negative value, where each no...

2018-02-02 09:02
49
• #### 222. Count Complete Tree Nodes

Given a complete binary tree, count the number of nodes. Definition of a complete binary tree fro...

2018-02-03 20:28
45
• #### 114. Flatten Binary Tree to Linked List

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

2018-02-03 21:59
275
• #### 235. Lowest Common Ancestor of a Binary Search Tree

Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BS...

2018-02-03 22:09
27
• #### 669. Trim a Binary Search Tree

Given a binary search tree and the lowest and highest boundaries as L and R, trim the tree so that...

2018-02-05 08:18
28
• #### 617. Merge Two Binary Trees

Given two binary trees and imagine that when you put one of them to cover the other, some nodes of t...

2018-02-05 08:55
28
• #### 655. Print Binary Tree

Print a binary tree in an m*n 2D string array following these rules: The row number m should be e...

2018-02-05 09:05
26
• #### 623. Add One Row to Tree

Given the root of a binary tree, then value v and depth d, you need to add a row of nodes with val...

2018-02-06 08:15
22
• #### 687. Longest Univalue Path

Given a binary tree, find the length of the longest path where each node in the path has the same va...

2018-02-06 08:29
26