+1 (218) 451-4151
glass
pen
clip
papers
heaphones

Consider a variant of Exercise C-7.29, in which an array of capacity N is resized to capacity…

Consider a variant of Exercise C-7.29, in which an array of capacity N is resized to capacity…

Consider a variant of Exercise C-7.29, in which an array of capacity N is resized to capacity precisely that of the number of elements, any time the number of elements in the array goes strictly below N/4. Give a formal proof that any sequence of n push or pop operations on an initially empty dynamic array takes O(n) time.Exercise C-7.29Revise the array list implementation given in Section 7.2.1 so that when the actual number of elements, n, in the array goes below N/4, where N is the array capacity, the array shrinks to half its size.