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


Please Help Members By Posting Answers For Below Questions

How to test the search functionality.For example in naukri advance search is there.how ca i test that page.

1656


Unix question: 1)command to print a list of files containing a particular word. 2) what does a .profile mean. 3) what is a file server? 4) Command to move towards left in vi editor explain grep and find commands using example.

2071


Is anybody have the telecom systems test cases from start to end?

1552


Please is there any one working with ITR.COM? Having interview with them. Any tips will help.

1385


What is the big deal about ‘requirements’?

725






How do you perform configuration management with typical revision control systems?

1644


Tell me a critical defect in which your Client,PM,PL appreciate on you

1483


sanity testing is done during regression testing.is it true.if it is true plz explain?

1464


What are the main key components in web applications?

751


Write all combinations of test cases for calculater on + symbel

1803


test cases on bangles???

2543


Can any tell me how a clinical data management system is tested? what are the test scenarios? what are the test cases? work flow.

1422


How can I use bugzilla in my company to track a bug and to allow the client to see the bug report online throughbugzilla. Please explain in detail. I am really need this.

2627


What is a testbed in manual testing?

953


What is 'Account Conditioning'?

3974