Searching, Sorting & Selection

Answer & solution
Official answer: C
Let m be the number of elements. Heapsort takes Θ(m log m). Choosing m=Θ(log n/log log n) gives log m=Θ(log log n), so m log m=Θ(log n). Hence C; m=Θ(log n) would require an extra log log n factor.
Use a new variable m for the input length, since n only describes the time budget. Heapsort costs Θ(m log m). Set L=log n. The candidate m=L/log L has log m=log L−log log L=Θ(log L), so m log m=Θ(L). Constant m is too small, and m=√L gives Θ(√L log L)=o(L). Setting m=L instead gives Θ(L log L), which is too large. Thus the inverse scale is log n/log log n.