File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,7 +17,8 @@ public ArrayNode(Integer v, int index) {
1717 value = v ;
1818 arrayIndex = index ;
1919 }
20- public String toString (){
20+
21+ public String toString () {
2122 return String .valueOf (value );
2223 }
2324 } // end of ArrayNode
@@ -44,7 +45,7 @@ public ArrayNode removeMin() {
4445 ArrayNode min = heap .get (1 );
4546 heap .remove (min );
4647
47- if (heap .size () != 1 ){
48+ if (heap .size () != 1 ) {
4849 shiftDown (1 );
4950 }
5051 return min ;
@@ -137,12 +138,12 @@ public static ArrayList<Integer> mergeSortedArray(Integer[][] arrays) {
137138 }
138139 }
139140
140- if (!done )
141+ if (!done )
141142 heap .insert (new ArrayNode (nextQueue .poll (), minNode .arrayIndex ));
142143
143144 }
144- while (!heap .isEmpty ())
145- result .add (heap .removeMin ().value );
145+ while (!heap .isEmpty ())
146+ result .add (heap .removeMin ().value );
146147
147148 return result ;
148149 }
You can’t perform that action at this time.
0 commit comments