Merge Program
Merge works as follows.
-
The values in the top two arrays are merged into the result array
at the bottom.
-
In each step of merging,
the smallest element in the unmerged parts of the top two arrays
is picked up and is added to the result array.
-
The merging proceeds until the elements in the top two arrays
are exhausted.
-
We use idx1 to designate the next element to be merged
from the first array, and idx2 to designate the next element
to be merged from the second array.
Source Code of the Merge Program
Source Code of the MergeG Program
(Graphical Version)
Back
Home