Minimum Window SubstringGiven a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).Fo...
Follow up for "Find Minimum in Rotated Sorted Array":
What if duplicates are allowed?
Would this affect the run-time complexity? How and why?
Suppose a sorted array is rotated at some pivot unkno...
分类:
其他好文 时间:
2014-12-08 23:09:33
阅读次数:
347
Minimum Window Substring
Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).
For example,
S = "ADOBECODEBANC"
T =...
Search in Rotated Sorted Array IIFollow up for "Search in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity...
分类:
其他好文 时间:
2014-12-08 17:23:29
阅读次数:
144
Search in Rotated Sorted Array IIFollow up for "Search in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity...
分类:
其他好文 时间:
2014-12-06 19:32:52
阅读次数:
173
Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.类似归并排序,对于lists[0, n-1],先对list[0,1], list[2, 3], ... li...
分类:
其他好文 时间:
2014-12-06 17:59:16
阅读次数:
181
Sort a linked list inO(nlogn) time using constant space complexity.时间复杂度为O(nlbn)的排序一般选择归并排序或快速排序,而且链表的归并不需要重新分配空间,也只需要常量的空间。一下是链表的归并排序实现: 1 ListNode *...
分类:
其他好文 时间:
2014-12-06 16:40:11
阅读次数:
168
Given a sorted array of integers, find the starting and ending position of a given target value.
Your algorithm's runtime complexity must be in the order of O(log n).
If the target is not found in t...
分类:
其他好文 时间:
2014-12-06 08:53:46
阅读次数:
155
Merge k Sorted ListsMerge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.Show Tags参考资料: http://blog.csdn....
分类:
其他好文 时间:
2014-12-05 12:13:13
阅读次数:
210
问题描述:
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 i...
分类:
其他好文 时间:
2014-12-04 23:21:47
阅读次数:
461