# 算法导论习题解答 17-4-3

## Exercise 17.4-3

Φ ( T ) = ∣ 2 ⋅ T . n u m − T . s i z e ∣ \Phi(T) = |2 \cdot T.num-T.size|

∑ j = 1 i − 1 C j ^ = ∑ j = 1 i − 1 C j + ( Φ j − Φ j − 1 ) = Φ i − 1 − Φ 0 + ∑ j = 1 i − 1 C j = Φ i − 1 + ∑ j = 1 i − 1 C j \sum_{j=1}^{i-1}\hat{C_j} = \sum_{j=1}^{i-1} C_j +( \Phi_{j} - \Phi_{j-1}) = \Phi_{i-1} - \Phi_0 + \sum_{j=1}^{i-1} C_j = \Phi_{i-1} + \sum_{j=1}^{i-1} C_j

∑ j = 1 i C j ^ ≥ ∑ j = 1 i C j \sum_{j=1}^{i}\hat{C_j} \ge \sum_{j=1}^{i} C_j

C i ^ = C i + ( 2 ⋅ n u m i − s i z e i ) − ( 2 ⋅ ( n u m i + 1 ) − s i z e i ) = 1 − 2 = O ( 1 ) \hat{C_i} = C_i + (2\cdot num_i - size_i) - (2\cdot (num_i + 1) - size_i) = 1 - 2 = O(1)

C i ^ = C i + ( − 2 ⋅ n u m i + s i z e i ) − ( − 2 ⋅ ( n u m i + 1 ) + s i z e i ) = 3 \hat{C_i} = C_i + ( - 2\cdot num_i + size_i) - ( - 2\cdot (num_i + 1) + size_i) = 3

C i ^ = C i + ( − 2 ⋅ n u m i + s i z e i ) − ( − 2 ⋅ ( n u m i + 1 ) + 3 2 s i z e i ) = ( 1 + n u m i ) + s i z e i − 2 ⋅ n u m i + 2 ⋅ n u m i + 2 − 3 2 s i z e i = 3 + n u m i − 1 2 s i z e i \hat{C_i} = C_i + ( - 2\cdot num_i + size_i) - ( - 2\cdot (num_i + 1) + \frac{3}{2}size_{i}) = (1 + num_i) + size_i - 2\cdot num_i + 2\cdot num_i + 2 - \frac{3}{2}size_{i} = 3 + num_i - \frac{1}{2}size_i

C i ^ = 3 + n u m i − 1 2 s i z e i < 3 \hat{C_i} = 3 + num_i - \frac{1}{2}size_i < 3

07-31

09-15
02-24
04-13 858
04-12 853
04-29 2670
04-28 6243
07-26 6190
11-14 1607
03-28 2355
06-14 641
07-25 114
04-29 1049
04-08
09-28
11-27 540