码迷,mamicode.com
首页 >  
搜索关键字:note to self    ( 21530个结果)
【LeetCode】Construct Binary Tree from Inorder and Postorder Traversal
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
ios 开启线程定时请求某个方法
- (void)startLoop {         [NSThread detachNewThreadSelector:@selector(loopMethod) toTarget:self withObject:nil]; } - (void)loopMethod {     [NSTimer scheduledTimerWithTimeInterval:3.0f...
分类:移动开发   时间:2014-08-01 19:42:52    阅读次数:186
#Leet Code# Populating Next Right Pointers in Each Node II
描述:注意需要先self.connect(right)再self.connect(left),否则会有case通不过,原因是左边递归执行时依赖与右边的next已经建立,而先执行connect(left)的话右边还没有完成关系的建立。代码: 1 class Solution: 2 # @par...
分类:其他好文   时间:2014-08-01 19:15:42    阅读次数:223
python小算法
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
Leetcode--Anagrams
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
ios7中使用scrollview来横向滑动图片,自动产生偏移竖向的偏移 问题
如图红色为scrollview的背景色,在scrollview上加了图片之后,总会有向下的偏移 设置contentOffset也不管用 在ios7中controller有个automaticallyAdjustsScrollViewInsets属性,默认为YES if (iOS7&&[self respondsToSelector:@selector(automaticall...
分类:移动开发   时间:2014-08-01 16:07:31    阅读次数:242
Leetcode--Multiply Strings
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
UINavigationcontroller页面跳转动画
第一种方式: MyViewController *my=[[MyViewController alloc] init]; [self.navigationController pushViewController:my animated:NO]; //因为一个事件循环机制中 ...
分类:其他好文   时间:2014-08-01 13:12:01    阅读次数:142
iOS 点击空白处收回键盘的几个简单代码
//收回键盘1-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ [self.view.subviews enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL....
分类:移动开发   时间:2014-08-01 12:59:21    阅读次数:257
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!