今晚再刷一题,题目如下:Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices o...
分类:
其他好文 时间:
2014-08-20 01:20:15
阅读次数:
197
Question:You are given two sorted arrays, A and B, where A has a large enough buffer at the end to hold B.Write a method to merge B into A in sorted o...
分类:
其他好文 时间:
2014-08-19 23:51:25
阅读次数:
309
Segments
Time Limit: 1000MS Memory Limit: 65536K
Total Submissions: 9564 Accepted: 2943
Description
Given n segments in the two dimensional space, write a program, which determines if ther...
分类:
其他好文 时间:
2014-08-19 19:12:15
阅读次数:
249
A technique for implementing read-copy update in a shared-memory computing system having two or more processors operatively coupled to a shared memory...
分类:
其他好文 时间:
2014-08-19 18:38:25
阅读次数:
263
1. 在本地apache下 php版本5.3.13 调用类的方法 :$res['data']=\helper::sort_two_array($res['data'],'SORT_DESC','time');//sort_two_array()方法是非静态的 是可以调用的2.但是 在nginx下.....
分类:
其他好文 时间:
2014-08-19 16:18:54
阅读次数:
164
Selection:selection is a trivial problem if the input numbers are sorted. If we use a sorting algorithm having O(nlgn) worst case running time, then t...
分类:
其他好文 时间:
2014-08-19 04:50:43
阅读次数:
200
题目链接:Median做了整整一天T_T尝试了各种方法:首先看了解答,可以用multiset,但是发现java不支持;然后想起来用堆,这个基本思想其实很巧妙的,就是维护一个最大堆和最小堆,最大堆存放前半部分较小的元素,最小堆存放后半部分较大的元素,并且最大堆的所有元素小于最小堆的所有元素;保持最大堆...
分类:
其他好文 时间:
2014-08-18 23:21:23
阅读次数:
537
F - 最大子矩形Time Limit:1000MS Memory Limit:10000KB 64bit IO Format:%I64d & %I64uSubmitStatusDescriptionGiven a two-dimensional array of positive and nega...
分类:
其他好文 时间:
2014-08-18 21:58:12
阅读次数:
312
Edit Distance
Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)
You have the following 3 operati...
分类:
其他好文 时间:
2014-08-18 20:35:02
阅读次数:
206
求两个已排过序的等长的数组的中位数(median of two sorted arrays)...
分类:
其他好文 时间:
2014-08-18 18:46:33
阅读次数:
337