Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorte...
分类:
其他好文 时间:
2014-07-07 16:53:17
阅读次数:
196
Problem Description:Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?Solution: 1 public bo....
分类:
其他好文 时间:
2014-07-07 16:08:01
阅读次数:
151
问题分析: [2014-01-16 20:18:26 - ] The connection to adb is down, and a severe error has occured. [2014-01-16 20:18:26 - ] You must restart adb and Eclips...
分类:
移动开发 时间:
2014-07-02 00:42:22
阅读次数:
333
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [?2,1,?3,4,?1,2,1...
分类:
其他好文 时间:
2014-07-01 00:23:01
阅读次数:
248
Fortran has two kinds of subprograms: subroutine and function. Usually, subroutine is a combination of several procedures generating side effects with...
分类:
其他好文 时间:
2014-06-30 12:43:00
阅读次数:
207
Building roads
Time Limit: 2000MS
Memory Limit: 65536K
Total Submissions: 6229
Accepted: 2093
Description
Farmer John's farm has N barns, and there are some cows that...
分类:
其他好文 时间:
2014-06-30 10:55:18
阅读次数:
146
var indexOfSorted = function f(arr,n){
//assume : arr has been sorted
var low = 0;
var high = arr.length - 1;
var mid = (low + high) / 2;
while(high - low > 1){
if(n == arr[low]){return low...
分类:
Web程序 时间:
2014-06-30 08:54:10
阅读次数:
978
Linux下Nginx的安装 如果出现:error: 'ngx_http_file_cache_node_t' has no member named 'length'异常,可能是ngx_cache_purge-2.1.tar.gz版本太旧导致...
分类:
系统相关 时间:
2014-06-30 00:11:43
阅读次数:
401
题目
Given an array of words and a length L, format the text such that each line has exactly L characters and is fully (left and right) justified.
You should pack your words in a greedy approa...
分类:
其他好文 时间:
2014-06-29 23:44:02
阅读次数:
357
【题目】
Given a linked list, determine if it has a cycle in it.
Follow up:
Can you solve it without using extra space?
【题意】
判断一个单向链表是否有环
【思路】
维护两个指针p1和p2,p1每次向前移动一步,p2每次向前移动两步
如果p2能够追上p1,则说明链表中存在环...
分类:
其他好文 时间:
2014-06-29 22:51:33
阅读次数:
267