Driver Code
i = 0 NEW_LINE k1 = 3 NEW_LINE k2 = 6 NEW_LINE a = [ 20 , 8 , 22 , 4 , 12 , 10 , 14 ] NEW_LINE ans = 0 NEW_LINE for i in range ( ( n // 2 ) - 1 , - 1 , - 1 ) : NEW_LINE INDENT minheapify ( a , i ) NEW_LINE DEDENT