Two class sections each hand in a list of scores already sorted in increasing order. MergeSorted reads the first list (its length, then its values) and the second one in the same way, and merges them into one sorted array without sorting again: repeatedly copy the smaller of the two front elements.
Write readList, isSorted and merge(int[] a, int[] b). If a list is not sorted, print Both lists must be sorted. For the input
5
1 5 16 61 111
4
2 4 5 6
the program prints
Merged: 1 2 4 5 5 6 16 61 111
Length: 9
Still sorted: true