这是 Robert Sedgewick 的算法第 4 版中的练习题 1.4.24。
Suppose that you have an N-story building and plenty of eggs. Suppose also that
an egg is broken if it is thrown off floor F or higher, and unhurt otherwise.
First, devise a strategy to determine the value of F such that the number of
broken eggs is ~lgN when using ~lgN throws, then find a way to reduce the cost to
~2lgF.
虽然lgN
解决方案很容易想到,但我完全不知道2lgF
解决方案。无论如何,我们没有得到 的值F
,那么2lgF
解决的依据在哪里?
任何人都可以对这个问题有所了解吗?谢谢。