- 博客(9)
- 收藏
- 关注
原创 find Minimum and Maximum in Rotated Sorted Arrray
int findMin(vector& nums) { int start = 0; int end = nums.size() - 1; while(start + 1 < end){ int mid = start + (end - start)/2; if(nums[mid] < nums[end
2016-01-26 05:00:42 225
原创 iOS学习笔记5-UIView
常见的iphone 尺寸: iphone 3gs 3.5寸: 320 x 480 @1x iphone 4 & 4s 3.5寸 320 x 480 @2x 640 X 960 iphone 5 5c 5s 320X 568 @2x 640 X 1136 iphone 6 4.7寸 375x 667 @2x 750x1344 ipho
2016-01-19 03:01:09 249
原创 Subtree
You have two every large binary trees: T1, with millions of nodes, and T2, with hundreds of nodes. Create an algorithm to decide if T2 is a subtree of T1. 1. 利用BFS 搜索到第一个node 与T2 的root相同,然后进行判断这两
2016-01-18 04:33:40 288
原创 Partition Array by Odd and Even
Partition an integers array into odd number first and even number second. Example Given [1, 2, 3, 4], return [1, 3, 2, 4] Challenge Do it in-place. 非常典型的two pointer: 一个左指针,一个右指针, 当left 指
2016-01-18 03:51:28 208
原创 Count 1 in Binary
Count how many 1 in binary representation of a 32-bit integer. Example Given 32, return 1 Given 5, return 2 Given 1023, return 9 Challenge If the integer is n bits with m 1 bits. Can you do
2016-01-18 03:25:16 208
原创 iOS 学习笔记4-NSDictionary 和 NSMutableDictionary
/* 字典: 存储的内存不是连续的, key-value 对应, */ // 创建方法: // 1.不常用,只有一组k-v NSDictionary* dict1 = [NSDictionary dictionaryWithObject:@"1" forKey:@"a"]; NSLog
2016-01-17 23:31:08 289
原创 iOS学习笔记3-NSArray 和 NSMutableArray
1. NSArray// OC 的数组相比C++, java的数组要更为强大,可以存储不同类型的对象, 并且OC只能存储对象 NSArray* array1 = [[NSArray alloc] initWithObjects:@"1", @"2", @"3", @"4", nil];// nil 不可少,用来判断结束 //1. 数组长度 int
2016-01-16 04:21:29 265
原创 iOS学习笔记2-NSString
主要分为两个部分1. NSString 2. NSMutableString 一. NSString char* s = "Hello"; NSString* str = @"Hello"; // OC, C 字符串转换 // C->OC NSString* str1 = [NSString stringWithUTF8Strin
2016-01-16 03:13:56 259
原创 iOS学习笔记1- OC的类的定义和继承
1. 关于成员变量访问修饰符 @interface MyClass : NSObject{ // 默认-受保护 // public, 类内类外都可以访问,并且可以继承 @public int _classInt; // 私有, 类内可以使用, 类外无法调用, 并且不可以被继承 @private // 受保护, 类内
2016-01-14 06:19:18 294
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人