Solutions of Theory of Algorithms assignment 17.4-3

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

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

View Full Document Right Arrow Icon
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
Background image of page 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

This note was uploaded on 11/07/2010 for the course CS 11841 taught by Professor Dr.ayman during the Spring '09 term at Alexandria University.

Ask a homework question - tutors are online