☰
WH
·
CSBank
首頁
題庫專區
模擬考專區
Pro 方案
聯絡我們
首頁
題庫
模擬考
Pro
聯絡
總覽
資料結構
388
演算法
212
作業系統
290
計算機組織與結構
266
離散數學
161
線性代數
182
資料結構
›
Ch7 搜尋與排序
第 49 題/共 76 題
◀
DS 49/76
錯題回報
00:00
49. Sorting、Divide and Conquer
#DS-07-049
中
Sorting
Divide and Conquer
📝
☆
Divide and conquer for sorting: Given a set of n integers, where n is exact power of 2:
A
(A) If I divide the n integers into 4 equal parts, conquer the 4 parts recursively, and merge the 4 parts into a sorted sequence in linear time, I get the sorted sequence in
O
(
n
log
n
)
O(n\log n)
O
(
n
lo
g
n
)
time.
B
(B) If I divide the n integers into 2 equal parts, sort the 2 parts using selection sort, I get the sorted sequence in
O
(
n
2
)
O(n^2)
O
(
n
2
)
time.
C
(C) If I divide the n integers into 2 equal parts, sort the 2 parts using heap-sort, I get the sorted sequence in
O
(
n
log
n
)
O(n\log n)
O
(
n
lo
g
n
)
time.
D
(D) Let
lg
n
\lg n
l
g
n
represent base-2 logarithm. If I divide the n integers into
⌈
n
/
lg
n
⌉
\lceil n/\lg n\rceil
⌈
n
/
l
g
n
⌉
parts with each part except the last part having m integers (
m
≤
lg
n
m\le \lg n
m
≤
l
g
n
), sort each part using heap-sort, and merge the
⌈
n
/
lg
n
⌉
\lceil n/\lg n\rceil
⌈
n
/
l
g
n
⌉
parts, I get the sorted sequence in
O
(
n
log
log
n
)
O(n\log\log n)
O
(
n
lo
g
lo
g
n
)
time.
📝 寫筆記
📄 交大110
重做
跳轉到第
題
← 上一題
下一題 →
答案/解析
▤
完整推導請見《WH 資工筆記 · 資料結構》Ch7 搜尋與排序
‹
本章題號 · 41–60 / 76
›
全部 76
易 63
中 13
難 0
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60