码迷,mamicode.com
首页 >  
搜索关键字:binary trees    ( 12390个结果)
【原创】leetCodeOj --- Binary Search Tree Iterator 解题报告
时间挤挤总是有的太久不做题,脑子都生锈了。来道水题练练手题目地址:https://leetcode.com/problems/binary-search-tree-iterator/题目内容:Implement an iterator over a binary search tree (BST)....
分类:其他好文   时间:2015-08-30 00:56:27    阅读次数:155
Java二叉排序树
二叉排序树(Binary Sort Tree)又称二叉查找(搜索)树(Binary Search Tree)。其定义为:二叉排序树或者是空树,或者是满足如下性质的二叉树:①若它的左子树非空,则左子树上所有结点的值均小于根结点的值;②若它的右子树非空,则右子树上所有结点的值均大于根结点的值;③左、右子树本身又各是一棵二叉排序树。上述性质简称二叉排序树性质(B...
分类:编程语言   时间:2015-08-29 23:18:14    阅读次数:308
[LeetCode]Lowest Common Ancestor of a Binary Search Tree
Lowest Common Ancestor of a Binary Search TreeGiven a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.Ac...
分类:其他好文   时间:2015-08-29 18:32:04    阅读次数:148
【LeetCode】67. Add Binary
题目:Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100".提示:此题我的第一反应是把输入的两个字符串转化为数字,相加以后再把结果转化为二进制输出,...
分类:其他好文   时间:2015-08-29 18:26:15    阅读次数:141
Linux的文件系统和文件类型
绝对路径:/根文件系统:rootfs文件系统挂载:LSB:FHS(文件系统层级结构标准)FHS:/boot:引导文件存放目录,例如kernel(vmlinuz)、bootloader(grub,grub2);/bin:binary,供用户使用的基本的命令;OS启动即会用到程序;/sbin:管理类的基本命令;/lib:基本共享库;内核模块;..
分类:系统相关   时间:2015-08-29 17:13:13    阅读次数:209
[LeetCode]Invert Binary Tree
Invert Binary TreeInvert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1我觉得返回void更好一些,就地翻转。还是...
分类:其他好文   时间:2015-08-29 16:58:01    阅读次数:159
[LeetCode]Maximum Depth of Binary Tree
Maximum Depth of Binary TreeGiven a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root ...
分类:其他好文   时间:2015-08-29 16:48:03    阅读次数:173
[LeetCode]Same Tree
Same TreeGiven two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally ide...
分类:其他好文   时间:2015-08-29 16:39:28    阅读次数:96
Binary Tree Paths
??         该题采用深搜就可以做了(其实树的很多问题用深搜的思路都可以解决的),从根节点开始记录路径上的每一个节点,每到一个叶子节点把路径放入结果vector中就可以了。 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * ...
分类:其他好文   时间:2015-08-29 12:39:57    阅读次数:190
LeetCode "Strobogrammatic Number III"
It can be solved based on the code from "Strobogrammatic Number II". The idea is pretty straight forward - binary search the boundaries.class Solution...
分类:其他好文   时间:2015-08-29 07:27:37    阅读次数:504
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!