In Section 27.4, we saw how to construct a merging network based on bitonic sorting. In this problem, we shall construct an odd-even merging network. We assume that n is an exact power of 2, and we wish to merge the sorted sequence of elements on lines a1, a2,..., an with those on lines an+1, an+2,..., a2n. If n = 1, we put a comparator between lines a1 and a2. Otherwise, we recursively construct two odd-even merging networks that operate in parallel. The first merges the sequence on lines a1, a3,..., an-1 with the sequence on lines an+1, an+3,..., a2n-1 (the odd elements). The second merges a2, a4,..., an with an+2, an+4,..., a2n (the even elements). To combine the two sorted subsequences, we put a comparator between a2i and a2i + 1 for i = 1, 2,..., n - 1.
a. Draw a 2n-input merging network for n = 4.
b. Professor Corrigan suggests that to combine the two sorted subsequences produced by the recursive merging, instead of putting a comparator between a2i and a2i+1 for i = 1, 2,..., n - 1, one should put a comparator between