資料結構›Ch7 搜尋與排序
第 43 題/共 76 題
◀ DS 43/76
43. Selection Algorithm、Median of Medians
#DS-07-043中Selection AlgorithmMedian of Medians
  1. Linear time algorithm for the Selection problem, (the computational problem to find the kth largest number among n numbers):

(a) Typical implementation is to divide the n numbers into ⌈n/5⌉\lceil n/5 \rceil groups. We then find the medians of the ⌈n/5⌉\lceil n/5 \rceil groups, and then find the median of those medians. After (Θ(n)+T(⌈n/5⌉))(\Theta(n) + T(\lceil n/5 \rceil)) time, we can drop a set S of numbers because S does not contain the answer. Show that ∣S∣≥n/4|S| \ge n/4 where |S| is the size of S. (4%).

(b) Can we divide the n numbers into ⌈n/7⌉\lceil n/7 \rceil groups instead of ⌈n/5⌉\lceil n/5 \rceil groups? Why or why not? (5%).

📄 交大112
跳轉到第題
▤完整推導請見《WH 資工筆記 · 資料結構》Ch7 搜尋與排序
本章題號 · 41–60 / 76