Unformatted text preview: amortized time of delete larger half S is  S  +ΔΦ =  S  + 2(  s  2 s  ) = 0 = O(1). ±or deleting m elements larger than half , it will be O(m). 3. Problem 17.43 on page 425 Solution: Show that the amortized cost of TABLEDELETE when α i1 ≥ 1 / 2 is bounded above by a constant. Notice that the ith operation cannot cause the table to contract since contract only occurs when a i < 1 / 4. We need to consider cases for the load factor α i . ±or both cases num i = num i11 and size i = size i1 . Assume α i ≥ 1 / 2 ˆ c i = c i + Φ i Φ i1 = 1 + (2 · num isize i )  (2 · num i1size i1 ) = 1 + (2 · num isize i )  (2 · ( num i + 1 size i ) = 1 Then consider α i < 1/2 ˆ c i = c i + Φ i Φ i1 = 1 + (2 · num isize i )  ( size i1 /2 num i1 ) = 3 · num i 3/2 · size i + 2 = 3 α i · size i 3/2 · size i + 2 < 3/2 · size i 3/2 · size i + 2 = 2...
View
Full Document
 Spring '08
 KAPOOR
 Algorithms, Analysis of algorithms, worst case, Median Finding algorithm, Illinois Institute of Technology Department of Computer Science, delete larger half

Click to edit the document details