A suffix array is a sorted array of all suffixes of a given string. The definition is similar to Suffix Tree which is compressed trie of all suffixes ...
分类:
其他好文 时间:
2014-11-08 13:38:45
阅读次数:
193
这次是做题最顺的一次,提交两次,耗时1分钟就ac了,错的那次是因为没有考虑到空链表,少了一个判断。/** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next...
分类:
其他好文 时间:
2014-11-08 07:04:13
阅读次数:
152
Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or equal...
分类:
其他好文 时间:
2014-11-08 00:46:40
阅读次数:
131
Follow up for "Search in Rotated Sorted Array":
What if duplicates are allowed?
Would this affect the run-time complexity? How and why?
Write a function to determine if a given target is in the...
分类:
其他好文 时间:
2014-11-07 19:10:51
阅读次数:
161
Find Minimum in Rotated Sorted Array IIFollow up for "Find Minimum in Rotated Sorted Array": What if duplicates are allowed?Would this affect the run-...
分类:
其他好文 时间:
2014-11-07 16:47:41
阅读次数:
233
Find Minimum in Rotated Sorted ArraySuppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 ...
分类:
其他好文 时间:
2014-11-07 16:34:34
阅读次数:
180
Problem Description
In computer science, the longest increasing subsequence problem is to find a subsequence of a given sequence in which the subsequence's elements are in sorted order, lowest to hig...
分类:
其他好文 时间:
2014-11-06 21:57:19
阅读次数:
187
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-11-06 21:43:55
阅读次数:
156
Given a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2, return1->2.Given1->1->2->3->3, retu...
分类:
其他好文 时间:
2014-11-06 19:29:56
阅读次数:
149
Suppose a sorted array is rotated at some pivot unknown to you beforehand.
(i.e.,
0 1 2 4 5 6 7 might become
4 5 6 7 0 1 2).
Find the minimum element.
You may assume no duplicate exists in the ...
分类:
其他好文 时间:
2014-11-06 17:35:17
阅读次数:
206