Question: Write a in java method that performs quick sort on int[]sortThisArray in descending order. When a pivot is determined to be in its final position,
Write a in java method that performs quick sort on int[]sortThisArray in descending order. When a pivot is determined to be in its final position, print out the contents of int[]sortThisArray and indicate the value of the pivot being set.
For example, if int[]sortThisArray contains 36, 64, 85, 44, 80, 54, 68, 49, the output of the program should match the example below.
The value of the pivot is: 49
64, 85, 80, 54, 68, 49, 36, 44,
The value of the pivot is: 68
85, 80, 68, 54, 64, 49, 36, 44,
The value of the pivot is: 80
85, 80, 68, 54, 64, 49, 36, 44,
The value of the pivot is: 64
85, 80, 68, 64, 54, 49, 36, 44,
The value of the pivot is: 44
85, 80, 68, 64, 54, 49, 44, 36,
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
