# Understanding sequential solution for the TAOCP 3 Million Men problem

The problem and solution of interest is described here: What does > mean in this TAOCP solution?

Can anyone explain following points in that solution:

1. How exactly we can build (x[i], x[i+2]) for 1 <= i <= N-2 ?
2. What exactly means "merge G with it"? Provide exact algorithm for merging these two files.
3. How steps 1-4 are executed? Is it:

if (condition 1) {
....
}
if (condition 2) {
....
}
if (condition 3) {
....
}
if (condition 4) {
....
}


or

if (condition 1) {
....
}
else if (condition 2) {
....
}
else if (condition 3) {
....
}
else if (condition 4) {
....
}


?

• The title you have chosen is not well suited to representing your question. Please take some time to improve it; we have collected some advice here. Thank you! Commented Jan 24, 2017 at 18:44

1. With a for loop that steps through the array and creates a new pair from the $i$th and $(i+2)$th elements, for each $i$.

2. The same as the merge step in merge sort.

3. There are no "otherwise"s in the statement in English, so there should be no else statements.

• possible to explain with an example of sorting {(b,c),(a,b),(d,e),(c,d)}? Commented Jan 25, 2017 at 17:09