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
problem:
Implement int sqrt(int x).
Compute and return the square root of x.
Hide Tags
Math Binary
Search
题意:计算平方根,没有指定精度,默认精度为0.00001
thinking:
(1)由于...
分类:
其他好文 时间:
2015-04-08 10:56:36
阅读次数:
192
又一道DFS题,题意如下:
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.
For example:
Given the below binary tree and sum
= 22,
5
...
分类:
其他好文 时间:
2015-04-08 09:12:40
阅读次数:
116
一道DFS的题目,题意如下:
Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent
a number.
An example is the root-to-leaf path 1->2->3 which represents the number 1...
分类:
其他好文 时间:
2015-04-08 09:12:29
阅读次数:
107
Minimum Depth of Binary TreeGiven a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root...
分类:
编程语言 时间:
2015-04-08 07:55:25
阅读次数:
137
Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as00000010100101000001111010011100), return ...
分类:
其他好文 时间:
2015-04-08 07:55:03
阅读次数:
150
Given a binary tree, imagine yourself standing on therightside of it, return the values of the nodes you can see ordered from top to bottom.For exampl...
分类:
其他好文 时间:
2015-04-08 07:52:00
阅读次数:
91
Path SumGiven a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the give...
分类:
编程语言 时间:
2015-04-08 06:35:37
阅读次数:
186