Question: Let L be a dynamic list implemented as an array A. Initially the size of Ais 1. Pushing an element to Lis equivalent to adding

 Let L be a dynamic list implemented as an array A.
Initially the size of Ais 1. Pushing an element to Lis equivalent

Let L be a dynamic list implemented as an array A. Initially the size of Ais 1. Pushing an element to Lis equivalent to adding an element to the end of the array. Once A is filled up. a new array A is initialized with a size that is double of array A, and all the contents of the earlier array A will be transferred to the new array. What is the size of array Aif 24 elements are already in it? Select one: a 24 O b. 25 c. 32 O d. 36 e cannot be determined If the array A has n elements, what is the worst case complexity of inserting an element in the list? Select one: oa 0(2) ob. O(logn) CO(n) od 0(1) e 0(2) Assume that each push operation (inserting element) and copy operation (copying element from old array to new array) has a cost of 1 each, what is the approximate average cost of per insertion operation if 513 elements are inserted to the list? (closest to the choices) Select one: oa 1 6.3 C.513 d. log 513 e. 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!