Solution: Merge a Number of Sorted Arrays
This review discusses the solution of the merge sorted arrays challenge in detail.
We'll cover the following...
We'll cover the following...
Solution#1
A naive solution to this problem would be:
- Append all the arrays one after another in an ArrayList say
Output. - Next, simply sort the
Outputusing the built-in Java function, i.e.,Collections.sort();.
Time complexity
Appending sorted arrays into an ArrayList array would take time. Since Collections.sort() runs in and the size of Output is ...