Question: Java Which of these statements about binary search is true? a. Searching a sorted array is O(log n). b. Searching an unsorted array is O(log
Which of these statements about binary search is true? a. Searching a sorted array is O(log n). b. Searching an unsorted array is O(log n). c. Searching a sorted linked list is as efficient as searching a sorted array. d. On each pass one element in the list is eliminated 2. The method for adding an element to the back of a queue is called a. push b. enqueue c. add d. none of the above Given a linked list containing the following values: first rightarrow 5 rightarrow 15 rightarrow 20 rightarrow null, which of the following best describes what needs to happen when 10 is added to the list? a. The node containing 5 must be changed to point to the node which contains 10. Then the node containing 10 can be added. b. The value from the first node (10) is copied over the value 5. Then the first node is deleted. Then first is set to the node that now contains 10. c. Create a node and place 10 in that node and then make first to point to the node containing 10. d. None of the above. Linear probing a. is used to insert values into a doubly linked list. b. is a method of resolving collisions which uses chaining in a hash table. c. is used only when we want to insert an item in the array. d. none of the above. 5. A data structure which exhibits FIFO behavior is known as a. An array. b. A Queue. c. A vector. d. None of the above. The worst-case performance of quick sort for n items is a. O(log n) b. O(n) c. O(n log n) d. O(n^2) e. None of the above In an array-based implementation of a queue, a possible solution to dealing with the full condition is to
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
