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.
- 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.
- There will be N space separated integers sorted in increasing order.
5
2 5 7 9 1
1 2 5 7 9
Python Implementation:
The input consists of one lines-
- Line contains space separated integers which are required to be sorted
Space separated integers sorted in non-decreasing order
5 2 4 3 1
1 2 3 4 5