Create a min heap of elements from first row of 2D array
HeapNode harr [ ] = new HeapNode [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { harr [ i ] = new HeapNode ( mat [ 0 ] [ i ] , 0 , i ) ; } HeapNode hr = new HeapNode ( 0 , 0 , 0 ) ; for ( int i = 1 ; i <= k ; i ++ ) {