卷別
資料結構與演算法
選擇國立臺灣大學 2026 · 考試 · 第 19 題
考科資料結構
(4 points) Consider a dynamic table that: (1) starts empty with capacity 1; (2) doubles its capacity when full; (3) shrinks its capacity by a factor of when the capacity and the number of stored elements falls below one quarter of the capacity. Assume that inserting or deleting an element costs 1, and resizing a table of size costs . Which statement is true when considering insertion and removal operations?
- (A)The worst-case cost of any single operation is , so amortized analysis is unnecessary.
- (B)Using aggregate analysis, the amortized cost per operation is .
- (C)If shrinking were performed when the table becomes half full instead of one quarter full, the amortized cost would still remain .
- (D)With the one-quarter shrinking rule, the amortized cost per operation is , but shrinking more aggressively to half capacity when the table is half-full can destroy this bound.
- (E)The amortized cost depends on the order of operations and cannot be bounded independently of the operation sequence.