打印一个对象:NSLog(@"%@", stu);
默认情况下打印的时对象的名字和内存地址;这时需要重写description方法// 重写description方法- (NSString
*)description{ return [NSString stringWithFormat:@"t...
分类:
其他好文 时间:
2014-06-02 00:35:15
阅读次数:
274
首先状态栏式view的属性,所以在viewController中直接重写:/** 修改状态栏
*/- (UIStatusBarStyle)preferredStatusBarStyle{ // 修改状态栏的颜色(白色) return
UIStatusBarStyleLightConten...
分类:
移动开发 时间:
2014-06-01 23:43:43
阅读次数:
371
UITabelView:常用属性@property (nonatomic) CGFloat
rowHeight; // will return the default value if unset@property (nonatomic)
CGFloat sect...
分类:
移动开发 时间:
2014-06-01 17:07:41
阅读次数:
394
【题目】
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 all 5 unique BST's shown below.
1 3 3 2 1
\ / / / \ ...
分类:
其他好文 时间:
2014-06-01 15:33:45
阅读次数:
297
【题目】
Reverse a linked list from position m to n. Do it in-place and in one-pass.
For example:
Given 1->2->3->4->5->NULL, m = 2 and n = 4,
return 1->4->3->2->5->NULL.
Note:
Given m, n satisfy the following condition:
1 ≤ m ≤ n ≤ length of list.
【题意】
...
分类:
其他好文 时间:
2014-06-01 15:08:34
阅读次数:
237
问题:
Given a collection of numbers, return all possible permutations.
For example,
[1,2,3] have the following permutations:
[1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2],
and [3,2,1].
分析:
...
分类:
其他好文 时间:
2014-06-01 15:04:42
阅读次数:
259
问题:
Given a collection of numbers that might contain duplicates, return all possible unique permutations.
For example,
[1,1,2] have the following unique permutations:
[1,1,2], [1,2,1],
and...
分类:
其他好文 时间:
2014-06-01 13:03:12
阅读次数:
324
【题目】
Given a string containing only digits, restore it by returning all possible valid IP address combinations.
For example:
Given "25525511135",
return ["255.255.11.135", "255.255.111.35"]. (Order does not matter)
【题意】
给定一个字符串,恢复并返回所有符合条件的IP串
【思路】...
分类:
其他好文 时间:
2014-06-01 13:01:56
阅读次数:
295
【题目】
Given a binary tree, return the inorder traversal of its nodes' values.
For example:
Given binary tree {1,#,2,3},
1
2
/
3
return [1,3,2].
Note: Recursive solution is trivial, could you do it iteratively?
confused what "{1,#,2...
分类:
其他好文 时间:
2014-06-01 13:01:23
阅读次数:
279
情况一:非静态成员函数C++的设计准则就是非静态成员函数至少和一般的非静态函数有相同的效率,因此非静态成员函数会被改写:举个例子:float
Point3d::magnitude3d()const {return x;}①改写函数原型,添加一个额外的参数this到member
function中,用...
分类:
其他好文 时间:
2014-06-01 11:44:45
阅读次数:
214