1、题目 - Linked List Cycle IIGiven a linked list, return the node where the cycle begins. If there is no cycle, return null.Follow up:Can you solve it w...
分类:
编程语言 时间:
2014-11-06 01:56:43
阅读次数:
221
#import "RootViewController.h"
#import "RootView.h"
@interface RootViewController ()
@property(nonatomic,retain)RootView *myview;
@end
@implementation RootViewController
- (id)initWithNibName:(NSSt...
分类:
移动开发 时间:
2014-11-04 22:44:59
阅读次数:
312
一、前言
ios开发中,@property的修饰就有很多的修饰词,如retain、assign、strong、weak、nonatomic等等,而这些修饰词在ARC模式下与非ARC模式下也是略有不同。下面先简单说说ARC模式
二、什么是ARC
ARC是iOS 5推出的新功能,全称为Automatic Reference Counting。一句话说,...
分类:
移动开发 时间:
2014-11-04 19:47:10
阅读次数:
262
Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it without using extra space?思路:...
分类:
其他好文 时间:
2014-11-04 10:40:26
阅读次数:
143
Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?思路:快慢指针的应用。快慢指针指的是移动的步长,即每次向前移动的快慢。例如可以让快指...
分类:
其他好文 时间:
2014-11-03 20:42:18
阅读次数:
204
strong相当于retain,week相当于assign:1. 接触过C,那么假设你用malloc分配了一块内存,并且把它的地址赋值给了指针a,后来你希望指针b也共享这块内存,于是你又把a赋值给 (assign)了b。此时a和b指向同一块内存,请问当a不再需要这块内存,能否直接释放它?答案是否定的...
分类:
其他好文 时间:
2014-11-03 14:19:13
阅读次数:
121
题意:求一个无向图的边权平均值最小的环思路:假设环中Σwi/t#include #include#include #include #define maxn 90000#define esp 0.00000001using namespace std;int head[maxn],point[max...
分类:
其他好文 时间:
2014-10-30 19:07:36
阅读次数:
225
MainViewController.h
@interface RootViewController : UIViewController
@property(nonatomic, retain)NSDictionary *dic;
@property(nonatomic, retain)NSArray *allKeys;
MainViewController.m
- (void)view...
分类:
其他好文 时间:
2014-10-30 11:52:11
阅读次数:
188
RootViewController.h
@interface RootViewController : UIViewController {
BOOL Close[15]; //用于存放每一组的收起展开状态 YES 是收起 NO是展开
UITableView *_tableView;
}
@property(nonatomic, retain)NSArray *da...
分类:
其他好文 时间:
2014-10-30 11:50:52
阅读次数:
113
设置带有导航栏的根视图控制器
RootViewController.h
@interface RootViewController : UIViewController
{
UITableView *_tableView;
}
@property(nonatomic, retain)NSArray *data; //存放原本的数据
@property(nonatomic, reta...
分类:
其他好文 时间:
2014-10-30 11:50:28
阅读次数:
182