码迷,mamicode.com
首页 >  
搜索关键字:binary    ( 11734个结果)
Path Sum
https://leetcode.com/problems/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...
分类:其他好文   时间:2015-05-05 01:15:10    阅读次数:184
Same Tree
题目Given two binary trees, write a function to check if they are equal or not. 分析写一个检查两个二叉树是否相等的函数...
分类:其他好文   时间:2015-05-04 22:16:06    阅读次数:114
[LeetCode] Binary Tree Level Order Traversal II
Binary Tree Level Order Traversal II Given a binary tree, return the bottom-up level order traversal of its nodes' values. (ie, from left to right, level by level from leaf to root). For examp...
分类:其他好文   时间:2015-05-04 20:14:35    阅读次数:182
[LeetCode] Add Binary
Add Binary Given two binary strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100". 解题思路: 题意为两个字符串表示的二进制相加,求结果。记住常字符串与字符串变量能够相加,但是字符串不能与数字相加,字符...
分类:其他好文   时间:2015-05-04 20:12:43    阅读次数:149
leetcode 190 Reverse Bits
Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return 964176192 (represented in binary as 00111001011110...
分类:其他好文   时间:2015-05-04 18:18:59    阅读次数:71
leetcode--Add binary
题目描述: Add Binary Given two binary strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100". 解题思路: 求两个二进制组成的数字的和。首先有几种特殊的情况,a、b均为空,a为空、b非空,a非空、b为空;我们...
分类:其他好文   时间:2015-05-04 18:13:48    阅读次数:154
Recover Binary Search Tree -- leetcode
Two elements of a binary search tree (BST) are swapped by mistake. Recover the tree without changing its structure. Note: A solution using O(n) space is pretty straight forward. Could you devis...
分类:其他好文   时间:2015-05-04 18:06:38    阅读次数:119
[LeetCode] Path Sum
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 bina...
分类:其他好文   时间:2015-05-04 15:30:49    阅读次数:113
公共祖先--binary tree
找binary tree中两个node第一个公共祖先。注意不一定是BST想法:p,q都在左子树,就branch left。如果都在right,就branch right。如果不在same side,就返回first common ancestor所以主要是在left subtree和right su...
分类:其他好文   时间:2015-05-04 13:31:09    阅读次数:155
【leetcode】Binary Search Tree Iterator(middle)
Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Callingnext()will return the next...
分类:其他好文   时间:2015-05-04 13:27:57    阅读次数:115
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!