Data Structures & AlgorithmsVery hardGATE CS

With 3 identical eggs and at most 5 drops, what is the largest number of floors for which you can always determine the critical floor (the lowest floor from which an egg breaks, possibly none)?

  1. A. 31
  2. B. 25
  3. C. 15
  4. D. 10

Correct answer: B. 25

f(t, e) = f(t−1, e−1) + 1 + f(t−1, e): one drop splits floors into those below (egg broke) and above (egg survived). The closed form is Σ C(t, i) for i = 1..3 = 25. 2^t − 1 would need unlimited eggs.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic