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-08-27 13:05:17
阅读次数:
226
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-08-26 17:19:16
阅读次数:
191
上学期学信息论这门课的时候,接触到了通信复杂度这个话题。我觉得这是一个非常有意思的领域。70年代时,姚期智老师也在这个领域作出了重要的成果。借用Matrix67文章里的一段话,介绍一下通信复杂度的定义。通信复杂度(communication complexity)主要研究这么一类问题: A 持有数据...
分类:
其他好文 时间:
2014-08-23 17:41:31
阅读次数:
273
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 ...
分类:
其他好文 时间:
2014-08-23 02:15:59
阅读次数:
157
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-08-21 22:33:34
阅读次数:
240
Sort a linked list inO(nlogn) time using constant space complexity.1st ( 7 tries)/** * Definition for singly-linked list. * struct ListNode { * in...
分类:
其他好文 时间:
2014-08-20 14:03:02
阅读次数:
198
There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be ...
分类:
其他好文 时间:
2014-08-20 14:01:22
阅读次数:
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 ...
分类:
其他好文 时间:
2014-08-20 13:47:32
阅读次数:
224
①原题 There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). ②乡村英语翻译一下 给你两个...
分类:
其他好文 时间:
2014-08-18 16:40:32
阅读次数:
155
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...