作者bernachom (Terry)
看板Grad-ProbAsk
标题[问题] 资结-排序
时间Thu Apr 16 23:36:59 2009
Given a list of n elements and assuming n is larger than 100
compare the performance of the following sorting algorithms
a)..
b)..
c) quick sort
d)..
(Hint:list them in ascending or descending order)
请教一下
c)是n^2吗??
可是书上是写nlogn..是书写错了吗?
谢谢
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.228.103.55
1F:→ SmallFoxChiC:应该是写错了 04/17 00:01
2F:推 sunneo:quick sort 要算 n^2 吗 = =? 04/17 00:18
3F:→ sunneo:hint的意思是把a,b,c,d以递增或递减排列 04/17 00:18
4F:→ sunneo:quick sort的average case 是n logn没错吧 04/17 00:19
5F:→ bernachom:可是递增、递减不是会造成最差情况吗? 04/17 00:33
6F:→ SmallFoxChiC:他是说或 所以是worst case吧 怎麽会是average case 04/17 00:45
7F:推 elfkiller:你误解了 提议是说把a b c d 依递增递减排序 04/17 01:40
8F:→ elfkiller:不是说阵列一开始的排列情形 04/17 01:40
9F:→ bernachom:原来是这样,谢谢 04/17 01:48