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
how to write optimum code to divide a 50 digit number with a 25 digit number??
What is meant by type specifiers?
why return type of main is not necessary in linux
Why isnt any of this standardized in c?
Define recursion in c.
What is the difference between char array and char pointer?
What is the basic structure of c?
What's the best way of making my program efficient?
Is null valid for pointers to functions?
Find duplicates in a file containing 6 digit number (like uid) in O (n) time.
can anyone please tell about the nested interrupts?
Can we replace the struct function in tree syntax with a union?
Is main is a keyword in c?
What is volatile, register definition in C
Do you know what are bitwise shift operators in c programming?