Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest le...
分类:
其他好文 时间:
2014-10-26 07:58:51
阅读次数:
161
Given a binary tree, return thelevel ordertraversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree{3,9,2...
分类:
其他好文 时间:
2014-10-26 06:48:34
阅读次数:
188
Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; }Populate each next pointe...
分类:
其他好文 时间:
2014-10-26 06:47:59
阅读次数:
160
Given a binary tree, return thebottom-up level ordertraversal of its nodes' values. (ie, from left to right, level by level from leaf to root).For exa...
分类:
其他好文 时间:
2014-10-26 06:47:17
阅读次数:
187
题目:
Given two binary trees, write a function to check if they are equal or not.
Two binary trees are considered equal if they are structurally identical and the nodes have the same value....
分类:
其他好文 时间:
2014-10-25 23:09:06
阅读次数:
447
找到,返回下標;
int binary_search(const int* a, int low_position, int high_position, const int key)
{
high_position--;
while(low_position < high_position) {
int mid_position = (low_position+...
分类:
其他好文 时间:
2014-10-25 23:04:40
阅读次数:
155
计算几何: 堆几何模版就可以了。。。。
Description
Problem E
2D Geometry 110 in 1!
This is a collection of 110 (in binary) 2D geometry problems.
CircumscribedCircle x1 y1 x2 y2 x3 y3
Fi...
分类:
其他好文 时间:
2014-10-25 22:59:03
阅读次数:
246
MAC上,安装p_w_picpathmagic:下载:http://www.p_w_picpathmagick.org/script/binary-releases.php#macosx安装:Create(orchoose)adirectorytoinstallthepackageintoandchangetothatdirectory,forexample:$cd$HOMENext,extractthecontentsofthepackage.Forexample:$tarxvzfIm..
分类:
系统相关 时间:
2014-10-25 18:54:49
阅读次数:
672
题目
Given a binary tree, find its maximum depth.
The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node....
分类:
其他好文 时间:
2014-10-25 18:50:01
阅读次数:
137
题目地址:Ural 1081
先用dp求出每个长度下的合法序列(开头为1)的个数。然后求前缀和。会发现正好是一个斐波那契数列。然后每次判断是否大于此时长度下的最少个数,若大于,说明这一位肯定是1,若小于,则肯定是0.就这样不断输出出来即可。
代码如下:
#include
#include
#include
#include
#include
#include
#include
...
分类:
其他好文 时间:
2014-10-24 23:40:46
阅读次数:
312