码迷,mamicode.com
首页 >  
搜索关键字:binary    ( 11734个结果)
leetcode -- Binary Tree Postorder Traversal
历史不容假设[问题描述]Given a binary tree, return thepostordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ 2 / 3retu...
分类:其他好文   时间:2014-08-14 19:30:29    阅读次数:191
Light OJ 1080 - Binary Simulation - (线段树区间更新 单点查询)
Description Given a binary number, we are about to do some operations on the number. Two types of operations can be here. 'I i j'    which means invert the bit from i to j (inclusive) 'Q i'    a...
分类:其他好文   时间:2014-08-14 14:10:59    阅读次数:215
二叉排序树的查找、插入和删除
1. 二叉排序树二叉排序树(Binary Sort Tree)或者是一棵空树,或者是具有下列性质的二叉树:(1)若左子树不空,则左子树上所有结点的值均小于它的根结点的值;(2)若右子树不空,则右子树上所有结点的值均大于它的根结点的值;(3)左、右子树也分别为二叉排序树;(4)没有结点值相同的结点。二...
分类:其他好文   时间:2014-08-14 13:44:30    阅读次数:332
Binary Tree Preorder Traversal
#define NULL 0class Solution {public: vector preorderTraversal(TreeNode *root) { stack s; vector v1; if(root!=NULL) s.p...
分类:其他好文   时间:2014-08-14 13:35:48    阅读次数:210
php关于精准计算的模块 BCMath
Php: BCMathbc是Binary Calculator的缩写。bc*函数的参数都是操作数加上一个可选的 [int scale],比如string bcadd(string $left_operand, string $right_operand[, int $scale]),如果scale没...
分类:Web程序   时间:2014-08-14 13:26:48    阅读次数:258
UVA - 12041 BFS (Binary Fibonacci String)
Description Problem B - BFS (Binary Fibonacci String) We are familiar with the Fibonacci sequence (1, 1, 2, 3, 5, 8, ...). What if we define a similar sequence for strings? Sounds interesting? Let...
分类:其他好文   时间:2014-08-14 10:45:58    阅读次数:252
[LeetCode] Scramble String(树的问题最易用递归)
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representatio...
分类:其他好文   时间:2014-08-13 22:17:17    阅读次数:189
Sum Root to Leaf Numbers
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...
分类:其他好文   时间:2014-08-13 18:17:26    阅读次数:208
【Leetcode长征系列】Balanced Binary Tree
原题: 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...
分类:其他好文   时间:2014-08-13 15:03:31    阅读次数:261
Path Sum II
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 andsum =...
分类:其他好文   时间:2014-08-13 14:39:26    阅读次数:153
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!