码迷,mamicode.com
首页 >  
搜索关键字:binary    ( 11734个结果)
LeetCode Validate Binary Search Tree
Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only n...
分类:其他好文   时间:2014-11-17 14:02:09    阅读次数:146
Unique Binary Search Trees
Givenn, how many structurally uniqueBST's(binary search trees) that store values 1...n?For example,Givenn= 3, there are a total of 5 unique BST's. 1.....
分类:其他好文   时间:2014-11-17 13:56:57    阅读次数:141
LeetCode:Binary Tree Level Order Traversal
题目描述: Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example: Given binary tree {3,9,20,#,#,15,7}, 3 / ...
分类:其他好文   时间:2014-11-17 12:26:22    阅读次数:171
LeetCode:Path Sum
题目描述: Given 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 given sum. For example: Given the below binary tr...
分类:其他好文   时间:2014-11-17 10:48:34    阅读次数:134
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 / \ ...
分类:其他好文   时间:2014-11-17 10:34:42    阅读次数:168
Validate Binary Search Tree
Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only n...
分类:其他好文   时间:2014-11-17 09:12:02    阅读次数:179
Leetcode-Sqrt(x)
Implement int sqrt(int x).Compute and return the square root of x.Analysis:Using binary search to find the solution. However, what need to be consider...
分类:其他好文   时间:2014-11-17 01:40:04    阅读次数:205
leetcode:Binary Tree Inorder Traversal
给一个二叉树,中序遍历这个树,输出得到的值...
分类:其他好文   时间:2014-11-17 00:32:33    阅读次数:167
Validate binary search tree
关于这道题目,不得不感慨leetcode真的是一个不错的网站,之前的代码是有bug的,当时AC了,现在测试用例更加完善了,于是不能AC了。 题目描述: Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The le...
分类:其他好文   时间:2014-11-16 23:08:48    阅读次数:362
Binary Tree Zigzag Level Order Traversal
Given a binary tree, return thezigzag level ordertraversal of its nodes' values. (ie, from left to right, then right to left for the next level and al...
分类:其他好文   时间:2014-11-16 18:36:32    阅读次数:232
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!