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.4-3 on page 425 Solution: Show that the amortized cost of TABLE-DELETE when i-1 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 i-1-1 and size i = size i-1 . Assume i 1 / 2 c i = c i + i- i-1 = 1 + (2 num i-size i ) - (2 num i-1-size i-1 ) = 1 + (2 num i-size i ) - (2 ( num i + 1 -size i ) = -1 Then consider i < 1/2 c i = c i + i- i-1 = 1 + (2 num i-size i ) - ( size i-1 /2 -num i-1 ) = 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