问题:给一个二叉树,写一个算法判断这个树是不是balanced。Solution
#1.第一次遇到这个问题时我的解法,如下:public class Solution { public boolean isBalanced(TreeNode
root) { if(root == ...
分类:
其他好文 时间:
2014-05-05 12:50:49
阅读次数:
263
ArraysArrays are zero-indexed, ordered lists of
values. They are a handy way to store a set of related items of the same type
(such as strings), thoug...
分类:
编程语言 时间:
2014-05-04 19:08:29
阅读次数:
533
travel the binary tree by level 4 ( from down to top and from left to right every level )
个人信息:就读于燕大本科软件工程专业 目前大三;
本人博客:google搜索“cqs_2012”即可;
个人爱好:酷爱数据结构和算法,希望将来从事算法工作为人民作出自己的贡献;
博客内容:tr...
分类:
其他好文 时间:
2014-05-04 18:22:16
阅读次数:
381
travel the binary tree by level 2 ( from top to down )
个人信息:就读于燕大本科软件工程专业 目前大三;
本人博客:google搜索“cqs_2012”即可;
个人爱好:酷爱数据结构和算法,希望将来从事算法工作为人民作出自己的贡献;
博客内容:travel the binary tree by level 2 (...
分类:
其他好文 时间:
2014-05-04 09:27:56
阅读次数:
334
travel the binary tree by level( from top to down)
个人信息:就读于燕大本科软件工程专业 目前大三;
本人博客:google搜索“cqs_2012”即可;
个人爱好:酷爱数据结构和算法,希望将来从事算法工作为人民作出自己的贡献;
博客内容:travel the binary tree by level( from top t...
分类:
其他好文 时间:
2014-05-04 09:17:12
阅读次数:
292
travel the binary tree by level 3 ( from down to top )
个人信息:就读于燕大本科软件工程专业 目前大三;
本人博客:google搜索“cqs_2012”即可;
个人爱好:酷爱数据结构和算法,希望将来从事算法工作为人民作出自己的贡献;
博客内容:travel the binary tree by level 3 ( f...
分类:
其他好文 时间:
2014-05-04 09:00:55
阅读次数:
294
更改第三方手机检测到的CPU厂商型号,在kernel\arch\arm\mach-msm下面对应的Board-*.c文件里更改,比如我们是8226的CPU,就要在Board-8226.c里将DT_MACHINE_START(MSM8226_DT, "Qualcomm MSM 8226 (Flattened Device Tree)") 这里的8226改成客户指定的型号,比如要改成8926,就要这...
分类:
其他好文 时间:
2014-05-03 21:41:37
阅读次数:
432
You are given a string, S, and a list of words, L, that are all of the same length. Find all starting indices of substring(s) in S that is a concatenation of each word in L exactly once and without an...
分类:
其他好文 时间:
2014-05-03 21:35:49
阅读次数:
310
A Star not a Tree?
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 3272
Accepted: 1664
Description
Luke wants to upgrade his home computer network from 10mbs...
分类:
其他好文 时间:
2014-05-03 21:31:49
阅读次数:
417
//非递归遍历一棵树 需要借助栈
#include
#include
struct Tree
{
int nValue;
Tree *pLeft;
Tree *pRight;
};
struct Stack
{
Tree *root;
Stack *pNext;
};
Stack *pStack = NULL;
void push(Tree *root)
{
St...
分类:
其他好文 时间:
2014-05-03 20:55:41
阅读次数:
325