#5722: 排序法的速度


stanley17112000 (Stanley)

學校 : 國立交通大學
編號 : 13580
來源 : [66.253.158.102]
最後登入時間 :
2019-02-16 03:29:47
d550. 物件排序 | From: [203.70.88.138] | 發表日期 : 2011-08-27 21:27

我發現了重大的秘密!!!!

這題用合併排序法比快速排序法快!!!!  ><

 
#6253: Re:排序法的速度


J99 (J)

學校 : 國立中正大學
編號 : 7447
來源 : [114.35.165.69]
最後登入時間 :
2012-05-12 15:32:46
d550. 物件排序 | From: [218.168.30.244] | 發表日期 : 2012-01-24 19:17

我發現了重大的秘密!!!!

這題用合併排序法比快速排序法快!!!!  ><


It is because qsort has poor time complexity O(n2) for partially sorted data.
But using merge sort for  partially sorted data has best time complexity O(n). 
#6255: Re:排序法的速度


david942j (文旋)

學校 : 臺北市立成功高級中學
編號 : 6086
來源 : [115.43.75.16]
最後登入時間 :
2017-02-18 13:17:39
d550. 物件排序 | From: [182.235.181.182] | 發表日期 : 2012-01-26 18:23

我發現了重大的秘密!!!!

這題用合併排序法比快速排序法快!!!!  ><


It is because qsort has poor time complexity O(n2) for partially sorted data.
But using merge sort for  partially sorted data has best time complexity O(n).

樓上..mergesort's complexity is always O(nlgn) no matter what data is ... 
#26636: Re:排序法的速度


s1082951 (Amadeus)

學校 : 國立嘉義女子高級中學
編號 : 107976
來源 : [120.113.205.1]
最後登入時間 :
2024-01-30 22:28:47
d550. 物件排序 | From: [1.200.252.140] | 發表日期 : 2021-08-17 21:56

我發現了重大的秘密!!!!

這題用合併排序法比快速排序法快!!!!  ><


It is because qsort has poor time complexity O(n2) for partially sorted data.
But using merge sort for  partially sorted data has best time complexity O(n).


.排序法最低只能到 nlogn吧

 
ZeroJudge Forum