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
题目:
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
题目链接Given a list, rotate the list to the right
bykplaces, wherekis non-negative.For
example:Given1->2->3->4->5->NULLandk=2,return4->5->1->2->3->NULL.首...
分类:
其他好文 时间:
2014-05-01 04:52:19
阅读次数:
288
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...
我感觉伸展树越来越模版了,没想到这么轻易的就过了。。。
把光标位置标记为pos
MOVE:pos++或者pos--
INSERT:把光标旋转至根部,然后把光标后一个字母旋转至根的右子树,然后把insert的内容插入到root的右子树的左子树
ROTATE:把光标旋转至根部,然后把光标后一个字母旋转至根的右子树,然后把rev[root10]取反
GET:得到光标位置的后...
分类:
其他好文 时间:
2014-04-29 13:31:22
阅读次数:
498