For which of the following data structures does the method T…

For which of the following data structures does the method T get(int index) have a complexity of O(N) in the worst case, where N is the size of the list? Note: An ArrayList is implemented using an oversize array. ArrayList.get(int index) returns the element at the given index within the oversize array.

Adding an instance field size of type int to track the numbe…

Adding an instance field size of type int to track the number of elements stored in a singly-linked list optimizes the worst-case runtime complexity (from linear time to constant time algorithm) of which of the following operations defined in ListADT? Select all which apply.

Reference Section: Methods from the LinkedNode class used to…

Reference Section: Methods from the LinkedNode class used to build a singly linked list:   LinkedNode(T item, LinkedNode next)   Constructs node combining item data with a reference to another node.   T getData()   Accesses the data reference within this node.   void setData(T item)   Mutates (changes) this node’s data to be item.   LinkedNode getNext()   Accesses the next reference within this node.   void setNext(LinkedNode n)   Mutates (changes) this node’s next reference to be n. Question: Which of the following correctly prints out the data associated with the THIRD element (aka the element of index 2) in a singly linked list of LinkedNode objects, where head refers to the first element of the list? Note: As usual in CS300, this implementation does not use a “dummy node”.