Question: 2. Which data structure would you choose to help track a collection of objects where only the object with the largest value needs to be
2. Which data structure would you choose to help track a collection of objects where only the object with the largest value needs to be readily accessible?
(a) a list (b) a stack (c) a queue (d) a hashtable (e) a heap
3. Which data structure would you choose to help track a collection of objects where only the object that has been tracked the longest needs to be readily accessible?
(a) a list (b) a stack (c) a queue (d) a hashtable (e) a heap
4. What is the run-time complexity of locating and retrieving the element in the middle (by index) of a circular, doubly-linked list with a sentinel head?
(a) O(1) (b) O(log N) (c) O(N) (d) O(N log N) (e) O(N2 )
5. What is the run-time complexity of determining whether a specified key exists in a hashtable containing N key/value pairs?
(a) O(1) (b) O(log N) (c) O(N) (d) O(N log N) (e) O(N2 )
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
