由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 有A[i]
相关主题
贡献两个Amazon的电话面试题一个特别的inplace merge two sorted arrays
有没有这样的题型请教一道题目
考古到一道题请教一道题
问道排序题贡献1个A家3面的面经,被老印坑了
请问可以用二分法判断一个数组是否sorted吗?求代码,median of K sorted list
请教一个排序的问题数组中找和为0的3个数,4个数
问一道F家的考古题external sorting的一个问题
求问一题,in-place排序一个字符数组里的词问道题的解题思路
相关话题的讨论汇总
话题: 数组话题: 排序话题: 性质话题: sort话题: element
进入JobHunting版参与讨论
1 (共1页)
b*****i
发帖数: 262
1
看到以前的面经,里面有这么道题,请问有什么思路?
g*****x
发帖数: 799
2
n-way merge sort吧
f*******4
发帖数: 1401
3
+1

【在 g*****x 的大作中提到】
: n-way merge sort吧
l****i
发帖数: 396
4
+1 ....

【在 f*******4 的大作中提到】
: +1
J*********n
发帖数: 370
5

this really doesn't make too much sense since you will have to maintain a
heap to retrieve the max element among the n elements, which turns out
to be O(nlgn). But without knowing A[i] < A[n+i], we can also achieve this
by some sorting algorithms.
Unless there is a quicker method to retrieve the max element, I don't see
the value of having this property.

【在 g*****x 的大作中提到】
: n-way merge sort吧
P********l
发帖数: 452
6
http://www.sureinterview.com/shwqst/558001
It is shell sort half way done. So, continue the shell sort until the step
length (N) is 1.
n-way sort is hard to be done in-place, but it is faster.
h**k
发帖数: 3368
7
复杂度是O(mlgN),m是数组长度,N是条件里的a(i) 于m的线性算法。

【在 J*********n 的大作中提到】
:
: this really doesn't make too much sense since you will have to maintain a
: heap to retrieve the max element among the n elements, which turns out
: to be O(nlgn). But without knowing A[i] < A[n+i], we can also achieve this
: by some sorting algorithms.
: Unless there is a quicker method to retrieve the max element, I don't see
: the value of having this property.

c******n
发帖数: 4965
8
简单。 just view them as N separate lists, each of which is completely
sorted. you just pick one for every N element.

【在 b*****i 的大作中提到】
: 看到以前的面经,里面有这么道题,请问有什么思路?
1 (共1页)
进入JobHunting版参与讨论
相关主题
问道题的解题思路请问可以用二分法判断一个数组是否sorted吗?
一个小公司面经请教一个排序的问题
问一道老题问一道F家的考古题
收集了几个 List相关的题求问一题,in-place排序一个字符数组里的词
贡献两个Amazon的电话面试题一个特别的inplace merge two sorted arrays
有没有这样的题型请教一道题目
考古到一道题请教一道题
问道排序题贡献1个A家3面的面经,被老印坑了
相关话题的讨论汇总
话题: 数组话题: 排序话题: 性质话题: sort话题: element