题目: 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 t...
分类:
其他好文 时间:
2014-04-30 03:20:07
阅读次数:
502
It is one of the fashion trends that never go
out of fashion, Louis Vuitton handbag ! And "being in fashion trends for many
years, and this season is ...
分类:
其他好文 时间:
2014-04-30 03:07:40
阅读次数:
510
Given preorder and inorder traversal of a tree,
construct the binary tree.Note:You may assume that duplicates do not exist in
the tree.思路:由前序遍历数组和中序遍历...
分类:
其他好文 时间:
2014-04-30 02:20:33
阅读次数:
366
收集一些对PHP研究较深的文章,方便平时的查阅。 1)弱类型变量实现 2)PHP的生命周期
3)变量的引用计数、写时复制(Reference counting & Copy-on-Write) 4)变量的存储方式 5)数组
6)HashTable API 7)面向对象
分类:
Web程序 时间:
2014-04-30 01:38:26
阅读次数:
565
1.如果你看到一个数组的行为方式很像一个数据结构,就可以把数组变成对象private int
aa,变成: int aa; public int GetAA() {return aa;}//好处:使得获取的数据更加有效
分类:
其他好文 时间:
2014-04-30 00:55:25
阅读次数:
373
//1.创建一个数组对象 int、float、char等等C语言的类型无法直接放到OC的数组里面
NSMutableArray*array = [NSMutableArrayarrayWithObjects:@"1",@"2",nil];
//2.使用NSNumber对NSInte...
分类:
其他好文 时间:
2014-04-30 00:53:19
阅读次数:
519
Given an arraySofnintegers, are there
elementsa,b,c, anddinSsuch thata+b+c+d= target? Find all unique quadruplets in
the array which gives the sum of ...
分类:
其他好文 时间:
2014-04-29 22:40:00
阅读次数:
438
package exp { object Main { def main(args:
Array[String]): Unit = { B[String].say("hello");
//B[String]后的括号可以省略,编译器知道这不是要用类型B而是要...
分类:
其他好文 时间:
2014-04-29 22:15:21
阅读次数:
500
对于包含N个数的输入数组来说,快速排序是一种最坏情况时间复杂度为O(n2)的排序算法。虽然最坏情况时间复杂度很差,但是快速排序通常是实际排序应用中最好的选择,因为它的平均性能非常好:它的期望时间复杂度是O(nlgn),而且O(nlgn)中的隐藏因子非常小。另外,它还能够进行原址重排,甚至在虚存环境中...
分类:
其他好文 时间:
2014-04-29 21:54:47
阅读次数:
508
题意:给你一个数组,问你交换最多K个数以后,最大子串和为多少;解题思路:枚举这个数组最大字串和的起点和终点,然后优先队列交换这段里面的小数去换外面的大数,即可求出答案!解题代码:
1 // File Name: c.cpp 2 // Author: darkdream 3 // Created Ti...
分类:
其他好文 时间:
2014-04-29 21:44:33
阅读次数:
605