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-09-10 17:36:20
阅读次数:
172
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-09-06 17:16:13
阅读次数:
252
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.思路:不断将相邻的链表两两合并,知道只剩一个链表为止。 1 class Solution { 2 pub...
分类:
其他好文 时间:
2014-09-06 14:51:13
阅读次数:
172
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-09-03 21:06:47
阅读次数:
241
Sort a linked list in O(n log n) time using constant space complexity. 1 package SortList; 2 3 import java.util.Iterator; 4 5 class ListNode { 6 7 ...
分类:
编程语言 时间:
2014-09-03 21:00:47
阅读次数:
291
Given an array of integers, every element appearstwiceexcept for one. Find that single one.Note:Your algorithm should have a linear runtime complexity...
分类:
其他好文 时间:
2014-09-03 12:55:46
阅读次数:
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 o...
分类:
其他好文 时间:
2014-08-31 22:39:31
阅读次数:
324
在computability theory 和 computational complexity thory中,decision problem(可判定问题)是一个问题在一些形式化系统中,根据输入的参数值,这个问题有一个确定的答案:yes 或者no. decision problem一般出现在...
分类:
其他好文 时间:
2014-08-29 22:34:18
阅读次数:
470
题目:
Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.
解析:合并k个有序链表,最后返回一个总的有序链表,分析并描述其复杂度。该题的实质为归并排序,平均时间复杂度为O(NlogN)。
...
分类:
其他好文 时间:
2014-08-29 11:05:07
阅读次数:
225
Median of Two Sorted Arrays
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 (...
分类:
其他好文 时间:
2014-08-27 14:47:18
阅读次数:
148