Question: Please answer the full question and write legibly Problem 2 (20 points). Use the potential method to give a bound on the worst-case running time
Problem 2 (20 points). Use the potential method to give a bound on the worst-case running time of a sequence of n operations on the following data structure X: INSERT on X with n elements takes time log n and increases X's potential by log n. . FIND on X with n elements takes time k + logn where k is the number of elements examined. It decreases X's potential by k-3. REMOVE on X with n elements takes time log n and increases the potential by 3. The data structure is initially empty. The potential of X is always 20 and is 0 if X is empty. Problem 2 (20 points). Use the potential method to give a bound on the worst-case running time of a sequence of n operations on the following data structure X: INSERT on X with n elements takes time log n and increases X's potential by log n. . FIND on X with n elements takes time k + logn where k is the number of elements examined. It decreases X's potential by k-3. REMOVE on X with n elements takes time log n and increases the potential by 3. The data structure is initially empty. The potential of X is always 20 and is 0 if X is empty
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
