Given inorder and postorder traversal of a tree, construct the binary tree.
Note:
You may assume that duplicates do not exist in the tree.
/**
* Definition for binary tree
* struct TreeNode {...
分类:
其他好文 时间:
2014-08-01 19:53:32
阅读次数:
222
/* Note:Your choice is C IDE */
#include "stdio.h"
#include
#include
#define N 4
void main()
{
int a[N][N];
int b[N][N];
int z,x,c,d,p,i,j;
for(c=0;c<N;c++)
srand(time(0));
a[...
分类:
其他好文 时间:
2014-08-01 19:48:02
阅读次数:
195
- (void)startLoop
{
[NSThread
detachNewThreadSelector:@selector(loopMethod)
toTarget:self
withObject:nil];
}
- (void)loopMethod
{
[NSTimer
scheduledTimerWithTimeInterval:3.0f...
分类:
移动开发 时间:
2014-08-01 19:42:52
阅读次数:
186
描述:注意需要先self.connect(right)再self.connect(left),否则会有case通不过,原因是左边递归执行时依赖与右边的next已经建立,而先执行connect(left)的话右边还没有完成关系的建立。代码: 1 class Solution: 2 # @par...
分类:
其他好文 时间:
2014-08-01 19:15:42
阅读次数:
223
1.长度为m的字符串a,长度为n的字符串b,(m>n) 判断b中的字母是否全在a中? O(n)最小.class Num(object): def getNum(self, m): numList = filter(lambda x: not [...
分类:
编程语言 时间:
2014-08-01 18:55:32
阅读次数:
202
Problem Description:
Given an array of strings, return all groups of strings that are anagrams.
Note: All inputs will be in lower-case.
分析:题目要求输出找出所有在字符串数组中的变形词,变形词的意思是指单词由相同的字母构成,只是字母在单词中的顺序...
分类:
其他好文 时间:
2014-08-01 16:09:01
阅读次数:
164
如图红色为scrollview的背景色,在scrollview上加了图片之后,总会有向下的偏移
设置contentOffset也不管用
在ios7中controller有个automaticallyAdjustsScrollViewInsets属性,默认为YES
if (iOS7&&[self respondsToSelector:@selector(automaticall...
分类:
移动开发 时间:
2014-08-01 16:07:31
阅读次数:
242
Problem Description:
Given two numbers represented as strings, return multiplication of the numbers as a string.
Note: The numbers can be arbitrarily large and are non-negative.
分析:两个string相乘...
分类:
其他好文 时间:
2014-08-01 16:06:01
阅读次数:
141
第一种方式: MyViewController *my=[[MyViewController alloc] init]; [self.navigationController pushViewController:my animated:NO]; //因为一个事件循环机制中 ...
分类:
其他好文 时间:
2014-08-01 13:12:01
阅读次数:
142
//收回键盘1-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ [self.view.subviews enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL....
分类:
移动开发 时间:
2014-08-01 12:59:21
阅读次数:
257