Question: Need help with this java question 6. [14 Points] Search & Sorting: a. (4 Points) suppose we are performing a binary search on a sorted
6. [14 Points] Search & Sorting: a. (4 Points) suppose we are performing a binary search on a sorted array called numbers initia lized as follows: 0 1 2 3 4567 8 9 10 11 12 13 14 in [] numbers 1, 3, 5,8, 15, 18, 22, 39, 40, 42, 50, 57, 71, 73, 74); // search for the value 42 int index = binarySearch(numbers, 42); l index binary search Write the indexes of the elements that would be examined by the (the mid value returned from the search. Assume that we are using the binary search algorithm s in our algorithm's code) and write the value that would be shown in lecture section. i. What are the indexes examined? ii. What is value returned? [10 Points] Given the following array of int elements: int numbers 7, 2, 8, 4, 1, 11, 9, 5, 3, 10 b. You don't need to write the code. Just show the working Show the state of the elements after 5 passes of the outermost loop of selection sort. i. Show a trace of 2 levels deep of the merge sort algorithm. Show the splitting of the overall array, plus one level deep of the recursive calls
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
