11948 - Partition Step of QuickSort (CS2351)   

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

 

 

 

Sample Input  Download

Sample Output  Download

Tags




Discuss