码迷,mamicode.com
首页 >  
搜索关键字:binary trees    ( 12390个结果)
Leetcode 236: 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 ...
分类:其他好文   时间:2017-12-03 13:59:10    阅读次数:195
Leetcode 235: 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 ...
分类:其他好文   时间:2017-12-03 12:55:33    阅读次数:134
Leetcode 230: Kth Smallest Element in a BST
Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Note: You may assume k is always valid, 1 ≤ k ≤ BST's ...
分类:其他好文   时间:2017-12-03 11:41:35    阅读次数:159
Leetcode 226: Invert Binary Tree
Invert a binary tree. to ...
分类:其他好文   时间:2017-12-03 11:20:09    阅读次数:132
十进制转换二进制
// 十进制转换二进制 private static String convertBinary(int sum) { StringBuffer binary = new StringBuffer(); while (sum != 0 && sum != 1) { binary.insert(0, s... ...
分类:其他好文   时间:2017-12-03 11:19:25    阅读次数:100
LeetCode 404. Sum of Left Leaves
Find the sum of all left leaves in a given binary tree. Example: ...
分类:其他好文   时间:2017-12-02 23:24:46    阅读次数:150
zz升级Mininet自带的OpenvSwitch
http://sdnhub.cn/index.php/mininet-upgrade-openvswitch/ ...
分类:Web程序   时间:2017-12-02 22:05:25    阅读次数:232
手把手教你实现一个完整的BST(超级详细)
查找基本分类如下: 1. 线性表的查找 顺序查找 折半查找 分块查找 2. 树表的查找 二叉排序树 平衡二叉树 B树 B+树 3. 散列表的查找 今天介绍 二叉排序树 。 二叉排序树 ( Binary Sort Tree ) 又称为 二叉查找树 ,它是一种对排序和查找都很有用的特殊二叉树。 1. 二 ...
分类:其他好文   时间:2017-12-02 16:19:27    阅读次数:192
topcoder srm 510 div1
problem1 link 令$f(x)$表示[0,x]中答案的个数。那么题目的答案为$f(b)-f(a-1)$ 对于$f(x)$来说,假设$x$有$d$位数字,即$[0,d-1]$,那么可以进行动态规划,令$dp(i,s)$表示已经考虑了$[i,d-1]$位的数字,状态为$s$的方案数。状态需要五 ...
分类:其他好文   时间:2017-12-02 16:09:51    阅读次数:190
[LeetCode] Binary Tree Upside Down
Given a binary tree where all the right nodes are either leaf nodes with a sibling (a left node that shares the same parent node) or empty, flip it up ...
分类:其他好文   时间:2017-12-02 13:06:06    阅读次数:144
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!