For the OrdArray class in the orderedArray.java program (Listing 2.4 on page 59), you are asked to add the following methods
Write code in main() of class OrderedApp that inserts some random numbers into the two source arrays, invokes merge() and common() and displays the contents of the resulting arrays. The source arrays may hold different numbers of data items. In your algorithm you will need to compare the keys of the source arrays, picking the smallest one to copy to the destination. You'll also need to handle the situation when one source array exhausts its contents before the other.
Source array A = {3, 6, 8, 8, 11, 17, 25, 34, 38, 46, 48, 48, 48, 57, 62, 69, 72, 72, 77, 83};
Source array B = {5, 8, 14, 25, 31, 37, 41, 48, 48, 52, 77, 82, 94};
Then, Destination array C (after merge) = {3, 5, 6, 8, 11, 14, 17, 25, 31, 34, 37, 38, 41, 46, 48, 52, 57, 62, 69, 72, 77, 82, 83, 94};
Destination array D (after common) = {8, 25, 48, 77};