码迷,mamicode.com
首页 >  
搜索关键字:sparse array    ( 29791个结果
【LeetCode】Remove Element
题目: Given an array and a value, remove all instances of that value in place and return the new length. The order of elements can be changed. It doesn't matter what you leave beyond the new len...
分类:其他好文   时间:2014-05-05 12:58:57    阅读次数:294
NSArray,NSMutableArray的一些常用方法
不可变数组 ——NSArray常用的初始化一个数组: NSArray *array1 = [[NSArray alloc] init]; NSArray *array2 = [NSArray array]; //对于上述两个方法,在NSArray中用的很少,因为这是一个空数组,它的值是不可...
分类:其他好文   时间:2014-05-05 11:25:12    阅读次数:272
[LeetCode] 在一堆字符串中找出包含相同字符的 group的较快方法,题 Anagrams
题目: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
对象字面量表示法
今天看书看到了一个没见过的词儿:对象字面量表示法,看过内容之后,发现这货就是Json,但又不仅仅是Json,于是好好的问了一番度娘,原来Json只是一个数组和对象字面量表示法的组合。先说下数组的字面量表示法数组其实也是对象,构造函数的方式创建数组方式如下:var myArr = new Array(...
分类:其他好文   时间:2014-05-04 12:35:21    阅读次数:250
【译】 AWK教程指南 5AWK中的数组
awk程序中允许使用字符串当做数组的下标(index)。利用这个特色十分有助于资料统计工作。(使用字符串当下标的数组称为Associative Array) 首先建立一个数据文件,并取名为 reg.dat。此为一学生注册的资料文件;第一栏为学生姓名,其后为该生所修课程。 ...
分类:其他好文   时间:2014-05-04 11:30:50    阅读次数:351
[codility]MaxProductOfThree
最近在学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
[codility]Distinct
最近在学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
[leetcode] Best Time to Buy and Sell Stock III
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
《C#图解教程》读书笔记之六:接口和转换
一、接口那点事儿 (1)什么是接口? 一组函数成员而未实现的引用类型。只有类和结构能实现接口。 (2)从IComparable接口看接口实例: 假设有如下一段代码,它使用Array类的一个静态方法Sort对一个未排序的int类型数组进行排序,并输出排序后的结果。using System;cl...
分类:其他好文   时间:2014-05-03 22:20:59    阅读次数:462
[ACM] poj 2823 Sliding Window (单调队列)
Sliding Window Time Limit: 12000MS   Memory Limit: 65536K Total Submissions: 36315   Accepted: 10756 Case Time Limit: 5000MS Description An array of size n ≤ 106 is gi...
分类:Windows程序   时间:2014-05-03 17:20:55    阅读次数:450
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!