Two SumGiven an array of integers, find two
numbers such that they add up to a specific target number.The function twoSum
should return indices of the...
分类:
其他好文 时间:
2014-05-15 10:48:59
阅读次数:
322
NSArray、NSSet、NSDictionary 集合类
可以用来装东西OC数组只能存放OC对象、不能存放非OC对象类型,如int、struct\enu等OC数组不能存放nil值1.NSArray 不可变数组1》.
NSArray *array1 = [NSArray array]; // 由....
分类:
其他好文 时间:
2014-05-15 10:23:07
阅读次数:
253
马毅,清华自动化和数学双学士,UCB电子工程与计算机科学硕士,博士,数学硕士。博士毕业时拿到了计算机视觉领域最高奖Marr prize。后来研究sparse
representation,开始领跑这个方向。现为UIUC计算机系副教授,MSRA视觉计算组负责人。马毅,成长于四川,就学于北京清华,深造于...
分类:
其他好文 时间:
2014-05-15 09:56:01
阅读次数:
382
std::auto_ptr 析构的时候调用 delete
操作符来自动释放所包含的对象boost::scoped_ptr / boost::scoped_array不能传递它所包含的对象的所有权
到另一个作用域指针boost::shared_ptr /boost::shared_array在内部记录...
分类:
其他好文 时间:
2014-05-15 02:01:07
阅读次数:
353
Single Number II
Total Accepted: 14472 Total
Submissions: 44420My Submissions
Given an array of integers, every element appears three times except for one. Find that single one.
Note:
Y...
分类:
其他好文 时间:
2014-05-15 01:23:42
阅读次数:
273
join()Array.join(/*optional*/separator)将数组转换为字符串,可带一个参数separator(分隔符,默认为“,”)。与之相反的一个方法是:String.splict(),将字符串分隔成若干块来创建一个新的数组。reverse()Array.reverse(),颠倒数组元素的顺序,返回逆向的数组.注意此方法会修..
分类:
编程语言 时间:
2014-05-15 00:31:23
阅读次数:
441
[ 问题: ]
Given an array of integers, find two numbers such that they add up to a specific target number.
The function twoSum should return indices of the two numbers such that they add up to the ta...
分类:
其他好文 时间:
2014-05-15 00:04:39
阅读次数:
377
program Test;{$APPTYPE CONSOLE}uses System,
System.SysUtils; const Value: array[0..5] of Byte = (5, 72, 101, 76, 76, 111); {
Old ShortString represent...
分类:
其他好文 时间:
2014-05-14 23:42:03
阅读次数:
475
Best Time to Buy and Sell Stock1Say you have an
array for which theithelement is the price of a given stock on dayi.If you were
only permitted to comp...
分类:
其他好文 时间:
2014-05-14 22:36:11
阅读次数:
353
题意:从一个已排序的数组中移除掉重复的元素,每个元素最多可重复两次
思路: 思路和Remove Duplicates from Sorted Array一样,不过要设置一个计数变量,表示当前值出现的次数
出现次数少于2可以加入到新数组,多于2则不可以。每次遇到一个新变量要把计数变量重新设置为1,加入新数组要加1
复杂度:时间O(n), 空间O(1)...
分类:
其他好文 时间:
2014-05-14 21:03:00
阅读次数:
262