优先队列头文件#include 默认优先为从大到小优先。自定义优先级 1 struct cmpmin{ //按从小到大 2 3 // 因为标准库默认使用元素类型的b; //所以规定小的元素...
代理设计模式:1、使用场合 -》 A想让B帮忙做一些事情,就让B成为A的代理 -》A想通知一下B发生了某些事情,或者想传递一些数据给B,就让B成为A的代理 -》B想监听A所做的一些事情,就让B成为A的代理2、使用步骤 -》定义一份协议 -》B要遵守协议,实现相应的方法 -》A中要定义一个代理属性,i...
UITableViewController 继承自ViewController,TableViewController自动给我们添加了dataSource和delegate。 里面只有一个UITableView 1、UITableViewController内部默认会创建一个UITableView ...
Given a set of distinct integers,S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not co...
iphone屏幕尺寸: iphone4/4s 320 480 iphone5/5s 320 568 iphone6 375 667 iphone6 plus 414 736@interface ViewController (){ NSArray *_allDescs;...
题目:Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-n...
UITableView的两种内置样式UITableViewStylePlain UITableViewStyleGrouped 协议UITableViewDataSource必须实现两个方法cellForRowAtlndexPath和...
NSNumber数字类型不能存入集合和字典,需要转换成对象。使用NSNumber(以int类型为例,还有其他很多类型的方法,用法参考下面的代码) //将整数转换成对象 NSNumber *num = [NSNumber numberWithInt:10]; //将num加入到字典中 NSDict.....
gcc 动态编译(共享库) 动态编译的可执行文件需要附带一个的动态链接库,在执行时,需要调用其对应动态链接库中的命令优点:体积小,编译快缺点:依赖性高代码如下:[root@74-82-173-217 shared]# cat add.cint add (int x, int y) {return x...
下面的不是指针指向数组,而是指针指向SliceI'm having a little play with google's Go language, and I've run into something which is fairly basic in C but doesn't seem to ...