Question: Compute the time and space complexity for all operations. at(int r): returns the element at index r without removing it set(int r, Object o): replace

Compute the time and space complexity for all operations.
at(int r): returns the element at index r without removing it
set(int r, Object o): replace the element at index r with o
insert(int r, Object o): insert a new element o to have index r
erase(int r): removes the element at index r
Show how to implement the Vectors operations using (a) Growable Array in a circular fashion (b) Singly Linked List (c) Doubly Linked List
Array Fixed-Size Growable Array Singly or Doubly Operation erase(r) insert(r,o) at(r) set(r,o) size() empty() O(1) best case O(n) worst case (r=0, n) O(n) average case Array Fixed-Size Growable Array Singly or Doubly Operation erase(r) insert(r,o) at(r) set(r,o) size() empty() O(1) best case O(n) worst case (r=0, n) O(n) average case
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
