不可变数组 ——NSArray常用的初始化一个数组: NSArray *array1 =
[[NSArray alloc] init]; NSArray *array2 = [NSArray array];
//对于上述两个方法,在NSArray中用的很少,因为这是一个空数组,它的值是不可...
分类:
其他好文 时间:
2014-05-05 11:25:12
阅读次数:
272
题目:Given an array of strings, return all groups of
strings that are anagrams.Note: All inputs will be in lower-case.class Solution
{public: vector ...
分类:
其他好文 时间:
2014-05-04 20:48:08
阅读次数:
608
1 #include 2 #include 3 4 void MerageSort(int *A,
int low, int high); 5 void Merge(int *A, int low, int middle, int high); 6 7 int
main() 8 { ...
分类:
其他好文 时间:
2014-05-04 20:44:56
阅读次数:
417
windows下安装redis1、redis简介redis是一个key-value存储系统。和Memcached类似,它支持存储的value类型相对更多,包括string(字符串)、list(链表)、set(集合)、zset(sorted
set --有序集合)和hashs(哈希类型)。这些数据类型...
今天看书看到了一个没见过的词儿:对象字面量表示法,看过内容之后,发现这货就是Json,但又不仅仅是Json,于是好好的问了一番度娘,原来Json只是一个数组和对象字面量表示法的组合。先说下数组的字面量表示法数组其实也是对象,构造函数的方式创建数组方式如下:var
myArr = new Array(...
分类:
其他好文 时间:
2014-05-04 12:35:21
阅读次数:
250
awk程序中允许使用字符串当做数组的下标(index)。利用这个特色十分有助于资料统计工作。(使用字符串当下标的数组称为Associative
Array) 首先建立一个数据文件,并取名为 reg.dat。此为一学生注册的资料文件;第一栏为学生姓名,其后为该生所修课程。 ...
分类:
其他好文 时间:
2014-05-04 11:30:50
阅读次数:
351
最近在学scala语言,scala代码如下:
import scala.collection.JavaConversions._
import scala.util.control.Breaks._
object Solution {
def solution(A: Array[Int]): Int = {
// write your code in Scala 2.10...
分类:
其他好文 时间:
2014-05-04 09:42:56
阅读次数:
372
最近在学scala语言,scala代码如下:
import scala.collection.JavaConversions._
object Solution {
def solution(A: Array[Int]): Int = {
// write your code in Scala 2.10
// using quick sort to so...
分类:
其他好文 时间:
2014-05-04 09:22:37
阅读次数:
341
Say you have an array for which theithelement
is the price of a given stock on dayi.Design an algorithm to find the maximum
profit. You may complete a...
分类:
其他好文 时间:
2014-05-03 23:21:20
阅读次数:
292
一、接口那点事儿 (1)什么是接口? 一组函数成员而未实现的引用类型。只有类和结构能实现接口。
(2)从IComparable接口看接口实例:
假设有如下一段代码,它使用Array类的一个静态方法Sort对一个未排序的int类型数组进行排序,并输出排序后的结果。using System;cl...
分类:
其他好文 时间:
2014-05-03 22:20:59
阅读次数:
462