7. (15 pts) A sequence of n operations are performed on a data structure initially in state Dy. The ith operation transf
Posted: Mon May 09, 2022 6:13 am
7. (15 pts) A sequence of n operations are performed on a data structure initially in state Dy. The ith operation transforms the data structure from state D; to state Di+1, 1 sis n. Let C(D) = {?vi if i is a perfect square (i. e.,12,22, 3...) Denote the cost of performing the ith operation, 1 sisn. Use the potential method to prove that the total cost of performing this sequence of n operations is at most 2n. Your analysis
should make use of the potential function đ(D) =i- (1vi – 1)”.
should make use of the potential function đ(D) =i- (1vi – 1)”.