This function takes an array of arrays as an argument and All arrays are assumed to be sorted . It merges them together and prints the final sorted output .
function mergeKArrays ( arr , a , output ) { var c = 0 ;