Question: Answering all would help a lot! In Java please! 1. Here is an array of ten integers: 5 3?8 9 1 7 0 2 6

Answering all would help a lot! In Java please!

1. Here is an array of ten integers:

5 3?8 9 1 7 0 2 6 4

Draw this array after the TWO recursive calls of merge sort are completed, and before the final merge step has occurred.

2. Here is an array of ten integers:

3?8 9 1 7 0 2 6 4

Suppose we partition this array using quicksort's partition function and using 5 1for the pivot. Draw the resulting array after the partition finishes.

3. Suppose we are sorting an array of eight integers using quicksort, and we have just finished the first partitioning with the array looking like this:

2 5?1 7 9 12 11 10

Which statement is correct?

A. The pivot could be either the 7 or the 9.

B. The pivot could be the 7, but it is not the 9.

C. The pivot is not the 7, but it could be the 9.

D. Neither the 7 nor the 9 is the pivot.

4. Write?a couple of?clear sentences to describe how a heapsort works.

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!