题目: Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; } Populate each next pointer to point to it
分类:
其他好文 时间:
2016-01-28 21:09:30
阅读次数:
250
废话不多说。直接上代码,哈哈,痛快: /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : va
分类:
其他好文 时间:
2016-01-28 19:17:22
阅读次数:
121
题目: Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer,
分类:
其他好文 时间:
2016-01-28 18:53:35
阅读次数:
138
struct Binary_Index_tree { long long a[N]; void init() { memset(a,0,sizeof(a)); } //位运算 int lowbit(int x) { return x & (-x); } //修改x这个点,并把所有包含x点的所有点都进
分类:
编程语言 时间:
2016-01-28 13:45:57
阅读次数:
133
Using DFS to traverse the BST, when we look through the BST to a certain node, this node must have the following property to make sure the tree is a v
分类:
其他好文 时间:
2016-01-28 13:45:06
阅读次数:
152
Link: https://leetcode.com/problems/balanced-binary-tree/ Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced
分类:
其他好文 时间:
2016-01-28 10:45:01
阅读次数:
141
树状数组(Binary Indexed Tree,BIT)是能够完成下述操作的数据结构。 给一个初始值全为0的数列a1,a2,...,an; 给定i,计算a1+a2+...+ai 给定i和x,执行ai += x 基于线段树的实现 BIT的结构 BIT的求和 BIT的值的更新 BIT的复杂度 BIT的
分类:
编程语言 时间:
2016-01-28 00:41:27
阅读次数:
222
题目: Given n, generate all structurally unique BST's (binary search trees) that store values 1...n. For example,Given n = 3, your program should return
分类:
其他好文 时间:
2016-01-28 00:37:47
阅读次数:
177
题目描述: 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
分类:
编程语言 时间:
2016-01-27 23:11:07
阅读次数:
165
目前主要有那些格式来作为虚拟机的镜像:raw(default) the raw format is a plain binary image of the disc image, and is very portable. On filesystems that support sparse fil
分类:
其他好文 时间:
2016-01-27 21:32:58
阅读次数:
453