Assume (for simplicity in this exercise) that only one tuple fits in a block and memory holds at most three blocks. Show the runs created on each pass of the sort-merge algorithm when applied to sort the following tuples on the first attribute: (kangaroo, 17), (wallaby, 21), (emu, 1), (wombat, 13), (platypus, 3), (lion, 8), (warthog, 4), (zebra, 11), (meerkat, 6), (hyena, 9), (hornbill, 2), (baboon, 12).


We will refer to the tuples (kangaroo, 17) through (baboon, 12) using tuple numbers through . We refer to the run used by the pass, as . The initial sorted runs have three blocks each. They are:

Each pass merges three runs. Therefore the runs after the end of the first pass are:

At the end of the second pass, the tuples are completely sorted into one run: