Given a binary tree, return the preorder traversal of its nodes' values.For example:Given binary tree {1,#,2,3}, 1 \ 2 /3return [1,2,3].可用递归,进行。也可以用迭代...
分类:
其他好文 时间:
2015-04-08 23:04:50
阅读次数:
157
用xftp传送文件时,需要输入ip地址,可连通的端口号,采用sftp协议输入数据库传送,属性binary,二进制上传文件,图片中文名称正常显示等,需要该属性支持UTF-8
分类:
其他好文 时间:
2015-04-08 22:47:46
阅读次数:
158
思路:
按层序遍历的思路,每次只保存该层的最后一个元素即可。...
分类:
其他好文 时间:
2015-04-08 21:37:11
阅读次数:
118
Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as00000010100101000001111010011100), return ...
分类:
其他好文 时间:
2015-04-08 21:10:38
阅读次数:
108
题目:
Given n, how many structurally unique BST's (binary search trees) that store values 1...n?
For example,
Given n = 3, there are a total of 5 unique BST's.
1 3 3 2 ...
分类:
其他好文 时间:
2015-04-08 18:14:31
阅读次数:
111
题目:
Given n, generate all structurally unique BST's (binary search trees) that store values 1...n.
For example,
Given n = 3, your program should return all 5 unique BST's shown below.
1 ...
分类:
其他好文 时间:
2015-04-08 18:10:34
阅读次数:
132
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 level and alternate between).
For example:
Given binary ...
分类:
其他好文 时间:
2015-04-08 15:07:05
阅读次数:
161
public class Solution { public TreeNode sortedListToBST(ListNode head) { if(head==null) return null; int len = 0; ListNode t =...
分类:
其他好文 时间:
2015-04-08 14:54:59
阅读次数:
125
二叉查找树简介
集合操作
search搜索
mininum寻找子树的最小key节点
maxnum子树最大key节点
predecessor前序寻找比此节点小的最大节点
succesor后序
insert插入
delete删除
c实现二叉查找树简介二叉查找树(Binary Search Tree),又被称为二叉搜索树。
它是特殊的二叉树:对于二叉树,假设x为二叉树中的任意一个结点,x节点包含关键字k...
分类:
编程语言 时间:
2015-04-08 11:01:45
阅读次数:
231