In order to properly answer the last question, several assumptions may have been
ID: 3702384 • Letter: I
Question
In order to properly answer the last question, several assumptions may have been made. What did you assume? For example, did write your Big-Oh in terms of array resizing? Or did you assume that the array didn't need to resize?
In this unit, we introduced three kinds of list ADTS, including the actual indexed list ADT provided by Java (see table). There are two primary ways such a table could be implemented: arrays and linked structures. Based on your knowledge of these data structures, complete the following table Method void add(E element) Description Array Big-Oh Linked Big-Oh Adds element to the end of the list. E get(int index) oid remove(int index) void remove(E object) Returns element at the index. Removes element at the index. Removes first occurrence of the object. int size0 Returns number of elements in the list. On the table, make bold the operations which have a different order. Give a brief explanation for the difference belowExplanation / Answer
add -> O(1) -> O(1) add -> O(n) -> O(n) get -> O(1) -> O(n) remove -> O(n) -> O(n) remove -> O(n) -> O(n) set -> O(1) -> O(n) size -> O(1) -> O(n) Assuming array doesn't need to resize, and holds current size of the array as a variable Assuming linked list has a tail pointer and does not hold size of the linked list as a variable