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
Why do we need a structure?
What is #include conio h?
can we change the default calling convention in c if yes than how.........?
What is the use of #include in c?
To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9
List some of the static data structures in C?
What extern c means?
What is a newline escape sequence?
Explain what are the different file extensions involved when programming in c?
a program that can input number of records and can view it again the record
Explain the difference between strcpy() and memcpy() function?
If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?
GIven a sequence of characters. How will you convert the lower case characters to upper case characters. ( Try using bit vector - sol given in the C lib -> typec.h)
Why should I use standard library functions instead of writing my own?
hw can we delete an internal node of binary search tree the internal node has child node..plz write progarm