← 返回数学题库
5699脑筋急转弯中等brainteasermedium

Sorting Five With Fewest Comparisons

题目

You must sort 5 distinct numbers using only pairwise comparisons, each of which returns which of the two compared elements is larger. What is the information-theoretic lower bound on the worst-case number of comparisons any comparison-based sorting algorithm needs, AND is that bound actually achievable for 5 elements? Give the minimum worst-case number of comparisons that guarantees a full sort.

解题计时

0:00

提交作答时记录,用于后续平均用时统计。

你的答案