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 Posted / 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 |
Post New Answer View All Answers
How to test an Scheduled event? For ex: in an investment banking application, the scheduler will create an equity anbd user has nothing to do but tester has to test if the instrument is created properly or not?
can anyone tell me the scenarios for online banking transaction ?
If automating - what is your process for determining what to automate and in what order
Can you explain tailoring?
what is metrics in software testing? give me a brief detail about it?
Differentiate test bed and test environment?
What is Stability and Performance Testing in Testing the TV
What kind of input do we need from the end user to begin proper testing?
hai friends i did my bcom (distance with out inter)and iam pursuing mca(distance alagappa university)iam learning testing cource in ameerpet can i elgibel for testing jobs pls guide me … …and send details to rangavijetha@gmail.com..thanks
if go through 1 or 2 projects clearly,then i feel comfortable to search the job,please help me
Hello can anybody list out supported and unsupported browsers for Window OS,Android OS,MAC OS Ubuntu
Explain the defect life cycle.
Assume a login page, and you have written 10 cases(say for example). How will you justify that these 10 testcase suffient for the login and how do you say this is 100% satisfies the need.
When have you had to focus on data integrity?
What is mutation testing & when can it be done?