Skip to content
This repository has been archived by the owner on Nov 26, 2019. It is now read-only.

Latest commit

 

History

History
58 lines (36 loc) · 982 Bytes

File metadata and controls

58 lines (36 loc) · 982 Bytes

Quick Sort

This program takes an array of size N and sort it in increasing order in O(nlogn) time for best case and O(n*n) for worst case.

Input Format

  • The input consists of two lines.
  • In the first line, there will be a single integer N.
  • In the second line, there will be N space separated integers.

Output Format

  • There will be N space separated integers sorted in increasing order.

Sample Input

5
2 5 7 9 1

Sample Output

1 2 5 7 9

Implemented in:

Python Implementation:

Input Format

The input consists of one lines-

  • Line contains space separated integers which are required to be sorted

Output Format

Space separated integers sorted in non-decreasing order

Sample Input

5 2 4 3 1

Sample Output

1 2 3 4 5

Implemented in: