Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Calling next() will return the next smallest number in the BST.Note: next() and hasN...
分类:
其他好文 时间:
2015-06-13 09:56:01
阅读次数:
100
树的遍历当初觉得难死,现在还好public class Solution { public ArrayList preorderTraversal(TreeNode root) { ArrayList res = new ArrayList(); if(root=...
分类:
其他好文 时间:
2015-06-13 07:35:26
阅读次数:
118
Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1Trivia:This problem was inspired by thi...
分类:
其他好文 时间:
2015-06-13 01:09:52
阅读次数:
201
Invert Binary TreeInvert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1Trivia:This problem w...
分类:
编程语言 时间:
2015-06-13 01:08:27
阅读次数:
288
Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1Trivia:This problem was inspired bythis...
分类:
其他好文 时间:
2015-06-13 01:05:26
阅读次数:
123
Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth of the two subtrees of every node never differ by...
分类:
其他好文 时间:
2015-06-12 23:57:34
阅读次数:
136
题目连接http://acm.hdu.edu.cn/showproblem.php?pid=3999The order of a TreeDescriptionAs we know,the shape of a binary search tree is greatly related to the...
分类:
其他好文 时间:
2015-06-12 23:50:33
阅读次数:
126
Problem Description:Given a binary tree where all the right nodes are either leaf nodes with a sibling (a left node that shares the same parent node) ...
分类:
其他好文 时间:
2015-06-12 23:47:36
阅读次数:
159
/bin为binary的简写主要放置一些系统的必备执行文件(常用的可执行的二进制命令), 所有用户都可以执行的。例如:cat、cp、chmod df、dmesg、gzip、kill、ls、mkdir、more、mount、rm、su、tar等。/boot 引导目录 整个操作系统引导所需要的都在/bo...
分类:
系统相关 时间:
2015-06-12 23:46:08
阅读次数:
179
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...
分类:
其他好文 时间:
2015-06-12 23:40:02
阅读次数:
121