Quote:
You're going to need one big array to hold the result. You just compare the "top of the deck" from each one -- the lower one goes in the big array and you move on to the next number in that array. Keep comparing until one array runs out of numbers. (And of course, the magic word is "merge sort".)
Usually in a merge sort, you have sorted data, and *then* you merge those pieces of sorted data together. So array1 (a1[]) gets sorted, then array2 (a2[]) gets sorted, and finally those arrays are merged together into array big[].