How & Why use Gray Code A gray counter is a binary counter where only one bit changes at a time. Gray code is mostly used to send values across clock
分类:
系统相关 时间:
2016-02-05 18:41:23
阅读次数:
187
题目: Given an array where elements are sorted in ascending order, convert it to a height balanced BST. 思路: 找到数组的中间数据作为根节点,小于中间数据的数组来构造作为左子树,大于中间数据的数组来构
分类:
其他好文 时间:
2016-02-05 18:41:10
阅读次数:
141
题目: Given preorder and inorder traversal of a tree, construct the binary tree. 思路: 线序序列的第一个元素就是树根,然后在中序序列中找到这个元素(由于题目保证没有相同的元素,因此可以唯一找到),中序序列中这个元素的左边就
分类:
其他好文 时间:
2016-02-05 11:44:41
阅读次数:
110
题目描述: Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nea
分类:
编程语言 时间:
2016-02-04 13:23:50
阅读次数:
235
You are given a binary tree (not necessarily BST) in which each node contains a value. Design an algorithm to print all paths which sum up to that val
分类:
其他好文 时间:
2016-02-04 12:29:30
阅读次数:
120
The gray code is a binary numeral system where two successive values differ in only one bit. Given a non-negative integer n representing the total num
分类:
其他好文 时间:
2016-02-04 06:45:56
阅读次数:
227
Binary Number Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1879 Accepted Submission(s): 1133 P
分类:
其他好文 时间:
2016-02-03 20:04:32
阅读次数:
256
98. Validate Binary Search Tree 题目 分析:BST按照中序遍历之后所得到的序列是一个递增序列,因此可以按照这个思路,先中序遍历,保存好遍历的结果,然后在遍历一遍这个序列。判断其是否递增 代码如下: 1 /** 2 * Definition for a binary t
分类:
其他好文 时间:
2016-02-03 14:32:36
阅读次数:
187
rpm 概述 rpm 执行安装包:二进制包(Binary)以及源代码包(Source)两种。二进制包可以直接安装在计算机中,而源代码包将会由RPM自动编译、安装。源代码包经常以src.rpm作为后缀名。 常用命令组合: rpm {-q|--query} [select-options] [query
分类:
其他好文 时间:
2016-02-03 11:39:37
阅读次数:
158
先定义二叉树: /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(
分类:
其他好文 时间:
2016-02-02 23:15:56
阅读次数:
196