poj 1744 tree 树分治

TreeTime Limit: 1000MS Memory Limit: 30000K   DescriptionGive a tree with n vertices,each edge has a length(positive int
16次阅读

HDU 4786 Fibonacci Tree 最小生成树

Fibonacci Tree题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=4786Description Coach Pang is interested in Fibonacci numbers while Uncle Yang wants him
12次阅读

[LeetCode] 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 value v at the given dep
11次阅读

binary-tree-inorder-traversal——二叉树中序遍历

Given a binary tree, return the inordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3 return
8次阅读

same-tree——比较两个二叉树是否相同

Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally identical an
17次阅读

leetcode-Symmetric Tree 对称树

Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmetric:1 / \ 2
10次阅读

binary-tree-zigzag-level-order-traversal——二叉树分层输出

Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next
13次阅读

maximum-depth-of-binary-tree——找出数的最大深度

Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest le
6次阅读

construct-binary-tree-from-preorder-and-inorder-traversal——前序和中序求二叉树

Given preorder and inorder traversal of a tree, construct the binary tree.Note:  You may assume that duplicates do not exist in the tree. 1
13次阅读

binary-tree-level-order-traversal I、II——输出二叉树的数字序列

IGiven a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level).For example:Given bina
11次阅读