A utility function to minheapify the node harr [ i ] of a heap stored in harr [ ]
static void minHeapify ( HeapNode [ ] harr , int i , int heap_size ) { int l = 2 * i + 1 ; int r = 2 * i + 2 ; int min = i ; if ( l < heap_size && harr [ l ] . val < harr [ i ] . val ) { min = l ; } if ( r < heap_size && harr [ r ] . val = 0 ) { minHeapify ( harr , i , n ) ; i -- ; } }