码迷,mamicode.com
首页 >  
搜索关键字:binary    ( 11734个结果)
[leetcode]Binary Tree InorderTraversal
Binary Tree Inorder TraversalGiven a binary tree, return theinordertraversal of its nodes' values.For example:Given binary tree{1,#,2,3}, 1 \ ...
分类:其他好文   时间:2014-08-31 18:27:01    阅读次数:168
[Erlang_Question21]Binary为什么可以节省大量的空间?
Binary灵魂和那些古老神话.
分类:其他好文   时间:2014-08-31 17:10:01    阅读次数:206
函数递归的几个例子
1.求二叉树的深度int TreeDepth(binary_Tree* pRoot){ if(pRoot==NULL) return 0; int nLeft=TreeDepth(pRoot->left); int nRight=TreeDepth(pRoot->ri...
分类:其他好文   时间:2014-08-31 17:06:01    阅读次数:132
Binary Tree Maximum Path Sum
这道题一眼看上去就是一个递归的算法,对于一棵树,分三种情况,包括根、仅左子树、仅右子树,递归的确认最大值,其中第一种情况(路径中包含根)分析可知它会一直包含根,后两中就复杂点,需要一直递归处理每颗子树。代码如下:int maxPathSumWithRoot(TreeNode *root) { if ...
分类:其他好文   时间:2014-08-30 21:43:10    阅读次数:307
Install CodeBlocks in CentOS 7
- For now, CodeBlocks doesn't privide binary packages for CentOS7.(http://www.codeblocks.org/downloads/26#linux64)- In this thread(http://forums.codeb...
分类:其他好文   时间:2014-08-30 17:45:39    阅读次数:237
ACdream1187(简单找规律)
C - Problem C Time Limit: 2000/1000MS (Java/Others) Memory Limit: 128000/64000KB (Java/Others) SubmitStatus Problem Description Consider an infinite complete binary tree where the root nod...
分类:其他好文   时间:2014-08-30 08:49:29    阅读次数:232
[LeetCode] Gray Code
The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integernrepresenting the total number...
分类:其他好文   时间:2014-08-30 02:22:18    阅读次数:244
LeetCode刷题笔录Add Binary
Given two binary strings, return their sum (also a binary string). For example, a = "11" b = "1" Return "100". 具体一位一位地加就行了,考虑进位的问题。还有最后记得把生成的string反过来再返回,因为我们是从最低位开始加的。 public class Solu...
分类:其他好文   时间:2014-08-30 01:16:58    阅读次数:286
[LeetCode] Convert Sorted Array to Binary Search Tree
Given an array where elements are sorted in ascending order, convert it to a height balanced BST./** * Definition for binary tree * public class TreeN...
分类:其他好文   时间:2014-08-30 01:10:48    阅读次数:333
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. For example: Given the below binary tree and sum ...
分类:其他好文   时间:2014-08-29 22:42:32    阅读次数:328
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!