{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Solutions of Theory of Algorithms assignment 17.4-3

# Solutions of Theory of Algorithms assignment 17.4-3 - i-1 |...

This preview shows page 1. Sign up to view the full content.

Solutions of Theory of Algorithms assignment Exercise 17.4-3 If i th operation triggers a contraction to the table (if α i-1 <1/3) size i =(2/3) size i-1 and num i-1 =(1/3) size i-1 and num i =num i-1 -1 Amortized cost= num i +1 +|2. num i -size i |-|2. num i-1 -size i-1 | =1/3(size i-1 )-1 +1+|2(num i-1 -1)-(2/3) size i-1 |-|2(1/3) size i-1 - size i-1 |
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: i-1 | =1/3(size i-1 ) +|2 ((1/3) size i-1-1)- (2/3) size i-1 |-|(-1/3) size i-1 | =1/3(size i-1 )+2- 1/3(size i-1 ) =2 if α i-1 >=1/3 num i =num i-1-1 and size i = size i-1 Amortized cost= 1 +|2. num i-size i |-|2. num i-1-size i-1 | = 1+|2 num i-1-2- size i-1 |-|2 num i-size i-1 | =1+2=3...
View Full Document

{[ snackBarMessage ]}