Driver program
public static void main ( String args [ ] ) { int arr [ ] = { 10 , 20 , 15 , 17 , 9 , 21 } ; int n = arr . length ; System . out . print ( " Given ▁ array : ▁ " ) ; printArray ( arr ) ; heapSort ( arr , n ) ; System . out . print ( " Sorted ▁ array : ▁ " ) ; printArray ( arr ) ; } }