Question: Java question 6. (14 Points] Search& Sorting: a. [4 Points) suppose we are performing a binary search on a sorted array called numbers initialized as

Java question
 Java question 6. (14 Points] Search& Sorting: a. [4 Points) suppose

6. (14 Points] Search& Sorting: a. [4 Points) suppose we are performing a binary search on a sorted array called numbers initialized as follows: // index 0 1 2 3 45 6 7 89 10 11 12 13 14 int ] numbers- hdmbr1, 3, 5, 8, 15, 18, 22, 39, 40, 42, 50, 57, 71,73,74): /l search for the value 42 int index-binarySearch(numbers, 42) Write the indexes of the elements that would be examined by the binary (the mid values in our algorithm's code) and write the value returned from the search. Assume that we are using the binary search a shown in lecture section. search that would be gorithm i. What are the indexes examined? ii. What is value returned? [10 Points] Given the following array of int elements: int numbers 17, 2, 8, 4, 1, 11, 9, b. 5, 3, 10); You don't need to write the code. Just show the working. i. Show the state of the elements after 5 passes of the outermost loop of selection sort. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!