There is a 100-story building and you are given two eggs.
The eggs (and the building) have an interesting property
that if you throw the egg from a floor number less than X,
it will not break. And it will always brake if the floor
number is equal or greater than X. Assuming that you can
reuse the eggs which didn't broke; you got to find X in a
minimal number of throws. Give an algorithm to find X in
minimal number of throws.

Answer Posted / chalimar

We are confused by the telling of this puzzle. Does the question really ask the minimum number of throws, or the minimum number of eggs? The second possibility is suggested by the clause, "Assuming that you can reuse the eggs which didn't [brake]." One answer here has made that presumption, starting at the first floor and going up floor by floor.

Is This Answer Correct ?    0 Yes 18 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to write optimum code to divide a 50 digit number with a 25 digit number??

2760


What is meant by type specifiers?

667


why return type of main is not necessary in linux

1710


Why isnt any of this standardized in c?

643


Define recursion in c.

706






What is the difference between char array and char pointer?

535


What is the basic structure of c?

565


What's the best way of making my program efficient?

631


Is null valid for pointers to functions?

618


Find duplicates in a file containing 6 digit number (like uid) in O (n) time.

2619


can anyone please tell about the nested interrupts?

1684


Can we replace the struct function in tree syntax with a union?

790


Is main is a keyword in c?

616


What is volatile, register definition in C

696


Do you know what are bitwise shift operators in c programming?

594