If we have 9 floor n 3 eggs n we have to check from which floor the egg wont get break.how can we do that
Answer / saurabh dhande
To find the floor from which the egg won't break, you can use a modified binary search algorithm. Here's a step-by-step explanation of the process:
Divide the building into intervals: Begin by dropping an egg from the middle floor (floor 5 in this case if there are 9 floors) using the first egg. If it breaks, then you know the critical floor must be below this floor. If it doesn't break, then you know the critical floor must be above this floor.
Determine the next interval: Based on the result of the first drop, you now have two sub-intervals left to explore. If the egg didn't break in the first step, you will drop it from the middle floor of the upper sub-interval (floors 6 to 9 in this case). If it breaks, you know the critical floor is one of these upper floors. If it doesn't break, the critical floor must be one of the lower floors (floors 1 to 4).
Continue dividing the intervals: Repeat the process until you narrow it down to a single floor. To do this, you will use the second egg as a safety net in case the critical floor is at the very top. This way, you minimize the number of egg drops required.
By following this approach, you should be able to find the critical floor with the minimum number of egg drops. The maximum number of attempts required using this method is 4 in the worst-case scenario.
In this specific example with 9 floors and 3 eggs, you can find the critical floor in at most 4 attempts.
| Is This Answer Correct ? | 0 Yes | 0 No |
Discuss what test metrics you feel are important to publish an organization?
What is the need of testing? Give three reasons....
28 Answers AZTEC, GE, Persistent, TCS,
Can test condition,testcase and testscript help u in performing the static testing
what is test case and test scenario , plz do explan with example....
Hi Friends, I have got 3 years of exp in IT industry in to Testing, working as Software test eng., in hyd.. kindly let me know any openings in Pune with this exp...contact @ swamyn.2k@gmail.com or pawan_your@yahoo.com
what is authorization & authentication?
When do u stop testing?
what is sychronization point in qtp how u put in yr application when it is put wat is its use how it is useful
3 Answers Polaris, Quick Heal, SAP Labs,
Interviewer asked me to write down the critical bugs in my career.i am working for the past 18 months in the banking domain. my answer didn't satisfied the interviewer,can any one help me to find out the critical bugs that may occur while working in banking domain?
9 Answers Accenture, Cerner, CybAge, RadixWeb,
Hai can any one tel me what is Concurency Testing?
what exactly done parallely in v-model with verification.
State a generalized process for load test? Or explain how you did it previously.