码迷,mamicode.com
首页 >  
搜索关键字:binary trees    ( 12390个结果)
leetcode || 96、Unique Binary Search Trees
problem: 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 ...
分类:其他好文   时间:2015-04-17 09:45:12    阅读次数:108
OJ练习18——T67 Add Binary
把以字符串表示的两个二进制数相加。【思路】活学活用昨天学到的reverse。将倒序相加变成正序相加。但这样的话,就要用到三个reverse,两个原串,最后还要把结果翻转。可能对速度有影响,经测试,好像还比不翻转快一点点。一个point是,两串长度不同,一串加完了另一串怎么办?我的办法是将其视为0,这...
分类:其他好文   时间:2015-04-17 09:33:59    阅读次数:135
Leetcode 112 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.Fo...
分类:其他好文   时间:2015-04-17 08:21:12    阅读次数:101
LeetCode - Binary Tree Right Side View
Binary Tree Right Side View2015.4.17 06:04Given a binary tree, imagine yourself standing on therightside of it, return the values of the nodes you can...
分类:其他好文   时间:2015-04-17 07:12:41    阅读次数:142
LeetCode - Reverse Bits
Reverse Bits2015.4.17 05:42Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as000000101001010...
分类:其他好文   时间:2015-04-17 07:09:09    阅读次数:108
【leetcode】Binary Tree Right Side View(middle)
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-16 23:42:02    阅读次数:159
BST迭代器
Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Calling next() will return the next smallest number in the BST.Note: next() and has...
分类:其他好文   时间:2015-04-16 17:45:41    阅读次数:151
【LeetCode从零单刷】Binary Tree Inorder Traversal
菜鸡从零单刷 LeetCode 系列!...
分类:其他好文   时间:2015-04-16 14:22:19    阅读次数:104
leetcode || 95、Unique Binary Search Trees II
problem: 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 bel...
分类:其他好文   时间:2015-04-16 12:34:36    阅读次数:111
leetcode_107题——Binary Tree Level Order Traversal II (二叉树,广度优先搜索,队列,栈)
Binary Tree Level Order Traversal IITotal Accepted:37829Total Submissions:122499My SubmissionsQuestionSolutionGiven a binary tree, return thebottom-up...
分类:其他好文   时间:2015-04-16 12:23:02    阅读次数:176
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!