boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - an old sorting algorithm
相关主题
一道google题
一个小公司面经
问一道老题
两个Sorted Array,找K smallest element
median of an array of ints, 请问这题的经典回答是什么?谢谢
Google电话面试题目
一个特别的inplace merge two sorted arrays
问个面试题
[算法] unsorted array
find median for k sorted arrays
相关话题的讨论汇总
话题: array话题: nlogm话题: algorithm话题: sorting话题: insert
进入JobHunting版参与讨论
1 (共1页)
j********r
发帖数: 453
1
two unordered array, one long,n , one short, m, sort them into a large array
. Someone say that we can sort the short array, it's mlogm, and binary
search and insert the long, the total is nlogm. but i am not clear about the
insert part, how it can be nlogm.
If there is a better algorithm, please share.
Thank for helps.
q****x
发帖数: 7404
2
can't be better than O((n+m)log(n+m))
otherwise, you can always split one single unsorted array into long/short
pair.

array
the

【在 j********r 的大作中提到】
: two unordered array, one long,n , one short, m, sort them into a large array
: . Someone say that we can sort the short array, it's mlogm, and binary
: search and insert the long, the total is nlogm. but i am not clear about the
: insert part, how it can be nlogm.
: If there is a better algorithm, please share.
: Thank for helps.

p*****2
发帖数: 21240
3

array
the
binary search也不是logm吧?注意m只是初始值,会越来越大。

【在 j********r 的大作中提到】
: two unordered array, one long,n , one short, m, sort them into a large array
: . Someone say that we can sort the short array, it's mlogm, and binary
: search and insert the long, the total is nlogm. but i am not clear about the
: insert part, how it can be nlogm.
: If there is a better algorithm, please share.
: Thank for helps.

1 (共1页)
进入JobHunting版参与讨论
相关主题
find median for k sorted arrays
c/c++ qsort/sort 来 sort array of string
Extension problem of finding intersection of two sorted array
哪里有讲k-way merge的?
请教一下external sorting的问题
刷题刷到没自信了
a[i] + b[j] = c[k] 的题有靠谱的答案不?
优步面试,哎。。。
一个cc150里面的题目,不解
收集了几个 List相关的题
相关话题的讨论汇总
话题: array话题: nlogm话题: algorithm话题: sorting话题: insert