Driver code
public static void main ( String [ ] args ) { int i = 0 ; int k1 = 3 ; int k2 = 6 ; int [ ] a = { 20 , 8 , 22 , 4 , 12 , 10 , 14 } ; int ans = 0 ; for ( i = ( n / 2 ) - 1 ; i >= 0 ; i -- ) { minheapify ( a , i ) ; }