码迷,mamicode.com
首页 >  
搜索关键字:binary    ( 11734个结果)
programming review (c++): (3)graph, binary search
I.graph   II.binary search 重在 begin=mid; end=mid; begin=mid+1; end=mid-1; if(begin<end)   if(begin<=end)的选择上。
分类:编程语言   时间:2016-03-13 22:28:07    阅读次数:299
[leetcode] 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 / 2 2 / \ / 3 4 4 3 But the following is...
分类:其他好文   时间:2016-03-13 18:06:55    阅读次数:153
Leet-code144. Binary Tree Preorder Traversal
这是一道将二叉树先序遍历,题目不难,采用深搜  
分类:其他好文   时间:2016-03-13 17:36:59    阅读次数:112
NYNU_省赛选拔题(7)
In computer science, a binary tree is a tree data structure in which each node has at most two children. Consider an infinite full binary tree (each n
分类:其他好文   时间:2016-03-13 14:34:03    阅读次数:184
Java二叉排序树(转)
一、二叉排序树定义 1.二叉排序树的定义 二叉排序树(Binary Sort Tree)又称二叉查找(搜索)树(Binary Search Tree)。其定义为:二叉排序树或者是空树,或者是满足如下性质的二叉树:①若它的左子树非空,则左子树上所有结点的值均小于根结点的值;②若它的右子树非空,则右子树
分类:编程语言   时间:2016-03-13 14:31:37    阅读次数:309
LintCode: Maximum Depth of Binary Tree
Given a binary tree, find its maximum depth.
分类:其他好文   时间:2016-03-13 14:29:24    阅读次数:167
[LeetCode235]Lowest Common Ancestor of a Binary Search Tree
题目: Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wikip
分类:其他好文   时间:2016-03-13 14:10:33    阅读次数:149
Lowest Common Ancestor of a Binary Search Tree
Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wikipedia
分类:其他好文   时间:2016-03-13 08:57:50    阅读次数:136
Lowest Common Ancestor of a Binary Tree
Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According to the definition of LCA on Wikipedia: “The lowes
分类:其他好文   时间:2016-03-13 08:52:28    阅读次数:134
110. Balanced Binary Tree
  这题还是简单的二叉树递归遍历相关的基础。   首先题目要求判断给出的是否平衡二叉树,而平衡二叉树又是左、右子树的高度差值小于1。所以我们判断前,先要知道左、右子树的高度值,所以我们要另外添加一个函数去遍历。   前面的思路还是很简单,但是被一个地方坑到。这就是在求出左、右子树高度值的函数里面,两
分类:其他好文   时间:2016-03-13 06:13:23    阅读次数:104
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!