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

Latest commit

 

History

History

heap_sort

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Heap Sort

This program takes an array of size N and sort it in increasing order in O(nlogn) time for both best as well as 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

6
7 9 1 2 3 4

Sample Output

1 2 3 4 7 9

Implemented in: