Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Which of these statements about binary search is true? a. Searching a sorted

ID: 3822082 • Letter: 1

Question

1. Which of these statements about binary search is true? a. Searching a sorted array is O( logn). 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 3. Given a linked list containing the following values: first 5 15 20 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 4. 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. 6. The worst-case performance of quick sort for n items is a. O(log n) o(n) b. c, O(n log n) d, o(na) e. None of the above 7. In an array-based implementation of a queue, a possible solution to dealing with the full condition is to

Explanation / Answer

1.A.the data should be sorted for a bineary search and it takesO(log n)

2.B. Enqueue means to insert an item into the back of the queue.

push is to add element into stack,add is used for aray lists/iterators in java

3.C

to add we create node ad change its pointer to point to first node,

4.B

Linear probing is technique where colloison happes during hashig,the probing is done and next available free space is occuied by the key

5.B FirstInFirstOut.

element inserted first will be ermoved first