A simple implementation of an n-way merge is to do n-1 comparisons of the first elements of the n sorted groups, to find the smallest element / group, and then output that element and get the next element from that same group. One alternative is to create and update a minimum heap of some type to keep track of which group contains the current smallest element.
During an n-way merge, when the end of one of the groups is reached, it becomes an (n-1)-way merge, then (n-2)-way merge, and so on. When there's only one group remaining, it's copied, and the n-way merge for that set of groups is complete.
To implement nMerge, a variable for number of groups is maintained. For each group, it's common to have a current index or pointer, and an ending index or pointer or a down counter for the number of elements remaining in a group. These can be in separate arrays or in array of structures. The array(s) are reordered according to the current elements of the group, so that array[0] contains group information for the group with the smallest current element. When a group reaches it's end, then array[0] is swapped with array[number of groups - 1], and number of groups is decremented. When number of groups is reduced to 1 the remainder of the final group is copied.