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 ord...
分类:
其他好文 时间:
2014-11-29 11:38:36
阅读次数:
128
题目: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="ADOBECOD...
Merge k Sorted ListsMerge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.两种实现方法,第一种采用优先队列,第二种采用分治/**
* Definition for singly-linked list.
* struct ListNo...
分类:
其他好文 时间:
2014-11-27 20:36:39
阅读次数:
227
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 ...
分类:
其他好文 时间:
2014-11-27 14:34:49
阅读次数:
200
Sort a linked list in O(n log n) time using constant space complexity.Analsys:We use Merge Sort.NOTE: We should practice other sort algorithm, linke Q...
分类:
其他好文 时间:
2014-11-27 01:35:39
阅读次数:
213
问题描述:
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 som...
分类:
其他好文 时间:
2014-11-26 22:40:43
阅读次数:
240
Sort a linked list in O(n log n) time using constant space complexity....
分类:
编程语言 时间:
2014-11-26 16:37:32
阅读次数:
172
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 = "ABC"
Minimum window is "BANC".
...
Follow up for "Search in Rotated Sorted Array":What ifduplicatesare allowed?Would this affect the run-time complexity? How and why?Write a function to...
分类:
其他好文 时间:
2014-11-26 13:45:50
阅读次数:
179
Given an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a linear runtime complexity...
分类:
其他好文 时间:
2014-11-25 14:21:59
阅读次数:
183