Analyzing Partition
Examine the partition(...) method of Example 8.6, and give a brief description of the algorithm underlying the code. Explain why it works. Use an example or diagrams to help you if necessary.
a. If x [] is the array [13, 4, 62, 26, 83, 6, 12, 55, 23, 81, 35], what value is returned by partition(x, 0, 10) ? What are the contents of x [] after the call partition(x, 0, 10) ?
b. If y [] is the array [3, 6, 8, 7, 9, 10, 13, 18, 36, 11], what value is returned by partition(y, 5, 9) ? What are the contents of y [] after the call partition(y, 5, 9) ?
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.