Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e.,0 1 2 4 5 6 7might become4 5 6 7 0 1 2).You are given a target value t...
分类:
其他好文 时间:
2014-07-18 20:00:41
阅读次数:
205
DescriptionThere are two strings A and B with equal length. Both strings are made up of lower case letters. Now you have a powerful string painter. Wi...
分类:
其他好文 时间:
2014-07-18 17:12:31
阅读次数:
252
The key of this problem is about details especially boundary conditions.class Solution {public: ListNode *deleteDuplicates(ListNode *head) { ...
分类:
其他好文 时间:
2014-07-18 14:36:54
阅读次数:
189
Not very hard to figure out the solution: splitting the list into 2 halves; reverse the 2nd half and interleave the two halves.But it takes some time ...
分类:
其他好文 时间:
2014-07-18 14:35:09
阅读次数:
214
public class Solution { public void merge(int A[], int m, int B[], int n) { int a=m-1; int b=n-1; int index=m+n-1; whil...
分类:
其他好文 时间:
2014-07-18 12:06:55
阅读次数:
147
Sorting It All Out
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 26866
Accepted: 9267
Description
An ascending sorted sequence of distinct values...
分类:
其他好文 时间:
2014-07-18 11:33:31
阅读次数:
294
B. Suffix Structures
Bizon the Champion isn't just a bison. He also is a favorite of the "Bizons" team.
At a competition the "Bizons" got the following problem: "You are given two distinct w...
分类:
其他好文 时间:
2014-07-18 11:15:25
阅读次数:
252
Given two integersnandk, return all possible combinations ofknumbers out of 1 ...n.For example,Ifn= 4 andk= 2, a solution is:[ [2,4], [3,4], [2,3],...
分类:
其他好文 时间:
2014-07-18 09:37:55
阅读次数:
161
Follow up for "Remove Duplicates":What if duplicates are allowed at mosttwice?For example,Given sorted array A =[1,1,1,2,2,3],Your function should ret...
分类:
其他好文 时间:
2014-07-17 22:24:40
阅读次数:
216
Write an efficient algorithm that searches for a value in anmxnmatrix. This matrix has the following properties:Integers in each row are sorted from l...
分类:
其他好文 时间:
2014-07-17 18:09:32
阅读次数:
258