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
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link...
分类:
其他好文 时间:
2014-05-01 22:08:19
阅读次数:
366
创建数组如果你习惯了用 new
来实例化对象的形式,那么在js中一定会疑惑,可选的参数数量代表的意义截然不同。new
Array(size);//传一个参数的时候分两种情况,size是正整数时代表数组的长度;size是其它非数字类型代表的是初始化有一个元素的数组;非正整数的尝试豪无意义new
Arr...
分类:
编程语言 时间:
2014-05-01 20:43:40
阅读次数:
427
/*#include #include #define N 100#define LIM
-100000000float det(float a[N][N],int n){ if(n==1) return a[0][0]; if(n==2)
return a[...
分类:
其他好文 时间:
2014-05-01 20:26:45
阅读次数:
322
没有想通为什么这个简单的问题竟然不是那么简单,太小看它了,以下是两个别人的很不错的solution:Solution1:
1 public class Solution { 2 public int removeDuplicates(int[] A) { 3 // Start...
分类:
其他好文 时间:
2014-05-01 20:19:26
阅读次数:
384
class testsetandget: kk = {}; def __getitem__(self,
key): return self.kk[key]; def __setitem__(self, key, value): self.kk[key] =
value;a = testset...
分类:
编程语言 时间:
2014-05-01 20:16:13
阅读次数:
449
/**js Unicode编码转换*/vardecToHex =function(str)
{varres=[];for(vari=0;i < str.length;i++)
res[i]=("00"+str.charCodeAt(i).toString(16)).slice(-4);return"...
分类:
Web程序 时间:
2014-05-01 19:36:51
阅读次数:
427
题目:
Given a sorted (increasing order) array, write an algorithm to create a binary tree with minimal height.
翻译:
给定一个有序数组(递增),写程序构建一棵具有最小高度的二叉树。
思路:
要使二叉树的高度最小,则要尽量使其左右子树的节点数目相当,自然就考虑到将其构造成为二叉排序树,且将有序数组的中间大的数作为根节点,这样得到的二叉树的高度便是最小的。...
分类:
其他好文 时间:
2014-05-01 17:48:45
阅读次数:
321
Merge k Sorted Lists
Total Accepted: 9746 Total
Submissions: 41674My Submissions
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity....
分类:
其他好文 时间:
2014-05-01 17:11:32
阅读次数:
234
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