This preview shows page 1. Sign up to view the full content.
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

Click to edit the document details