Driver program to test above functions
public static void main ( String [ ] args ) { int [ ] [ ] arr = { { 2 , 6 , 12 , 34 } , { 1 , 9 , 20 , 1000 } , { 23 , 34 , 90 , 2000 } } ; int k = 4 ; int n = 3 ; int [ ] output = new int [ n * k ] ; mergeKArrays ( arr , n , output ) ; System . out . println ( " Merged ▁ array ▁ is ▁ " ) ; printArray ( output , n * k ) ; } }