11948 - Partition Step of QuickSort (CS2351)
|
Time |
Memory |
| Case 1 |
1 sec |
32 MB |
| Case 2 |
1 sec |
32 MB |
| Case 3 |
1 sec |
32 MB |
| Case 4 |
1 sec |
32 MB |
| Case 5 |
1 sec |
32 MB |
| Case 6 |
1 sec |
32 MB |
| Case 7 |
1 sec |
32 MB |
| Case 8 |
1 sec |
32 MB |
Description
Given
- List of distinct integers
- Required order: ascending or descending
Perform the partition step of QuickSort once
- Use the last number as the pivot
- Do swaps to partition the list according to the pivot
- Print out the list


Note:
The total score of quiz 5 will be 160. (20 points for each input)
Input

Output

Tags