[CS] Career Cup上的一道题# JobHunting - 待字闺中
G*A
1 楼
朋友发来问我,说是答案是14 steps maximum. 但是我觉得如果用binary search tree
,最多7 steps就找出来了。请大家看看我是哪里没理解对。 谢谢
************
Q: There is a building of 100 floors. If an egg drops from the Nth floor or
above it will break. If it’s dropped from any floor below, it will not
break. You’re given 2 eggs. Find N, while minimizing the number of drops
for the worst case.
************
,最多7 steps就找出来了。请大家看看我是哪里没理解对。 谢谢
************
Q: There is a building of 100 floors. If an egg drops from the Nth floor or
above it will break. If it’s dropped from any floor below, it will not
break. You’re given 2 eggs. Find N, while minimizing the number of drops
for the worst case.
************