AF解析json出错:
Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn’t be completed. (Cocoa error 3840.)"
(JSON text did not start with array or object and option to allow fragments not set....
分类:
其他好文 时间:
2014-07-22 23:04:13
阅读次数:
400
创建数组如果你习惯了用 new
来实例化对象的形式,那么在js中一定会疑惑,可选的参数数量代表的意义截然不同。new
Array(size);//传一个参数的时候分两种情况,size是正整数时代表数组的长度;size是其它非数字类型代表的是初始化有一个元素的数组;非正整数的尝试豪无意义new
Arr...
分类:
编程语言 时间:
2014-05-01 20:43:40
阅读次数:
427
没有想通为什么这个简单的问题竟然不是那么简单,太小看它了,以下是两个别人的很不错的solution:Solution1:
1 public class Solution { 2 public int removeDuplicates(int[] A) { 3 // Start...
分类:
其他好文 时间:
2014-05-01 20:19:26
阅读次数:
384
题目:
Given a sorted (increasing order) array, write an algorithm to create a binary tree with minimal height.
翻译:
给定一个有序数组(递增),写程序构建一棵具有最小高度的二叉树。
思路:
要使二叉树的高度最小,则要尽量使其左右子树的节点数目相当,自然就考虑到将其构造成为二叉排序树,且将有序数组的中间大的数作为根节点,这样得到的二叉树的高度便是最小的。...
分类:
其他好文 时间:
2014-05-01 17:48:45
阅读次数:
321
1 /// 2 /// 冒泡排序法-for循环 3 /// 4 /// 5 private
static void BubbleSort(int[] array) 6 { 7 ...
分类:
其他好文 时间:
2014-05-01 09:19:38
阅读次数:
279
本次内容:java常用类1、包装类 1 package array; 2 3 public class
wrapperclass { 4 public static void main(String[] args) 5 { 6 Integer i=new
Inte...
分类:
编程语言 时间:
2014-05-01 09:16:28
阅读次数:
384
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 nu...
分类:
其他好文 时间:
2014-05-01 08:35:40
阅读次数:
443
NSPredicate:对self每个对象通过谓词进行筛选,判断是否与条件相匹配。作用相当于数据库的过滤取。主要用于从集合中分拣出符合条件的对象,也可以用于字符串的正则匹配第一、contains
判断 NSArray*array = [[NSArrayalloc]initWithObjects:.....
分类:
其他好文 时间:
2014-05-01 02:43:05
阅读次数:
258
1:temp = array[i]*i: 2410.0 ms
2:temp = GET(array,i) *i: 2410.0 ms
3:temp = get(array,i)*i: 2950.0 ms
4:int a = get(array,i);temp = a*i: 3340.0 ms
5: int a = array[i];temp = a*i;: 1990.0...
分类:
其他好文 时间:
2014-04-30 22:25:38
阅读次数:
303
Sliding Window
Time Limit: 12000MS
Memory Limit: 65536K
Total Submissions: 36147
Accepted: 10700
Case Time Limit: 5000MS
Description
An array of size n ≤ 106 i...