question 1
How many comparisons does the sort make lining up the letters of ehegfbbg, the earlier letter first on a tie?
the answer, and why
the answer is D
In letter order the weights are b 2, e 2, f 1, g 2, h 1. The sort lines them up lightest first, the earlier letter first on a tie, with 7 comparisons.
if you chose another
- That counts the 8 letters of the text, but the sort lines up the 5 different letters.
- That is the joins, one fewer than the 5 letters.
- That counts the different letters, not the comparisons between them.