tag:blogger.com,1999:blog-5573456362841621035.post1018041126987557092..comments2013-10-04T12:42:39.375-07:00Comments on Puzzles for Puzzled Minds...: Dropping Eggs from a Building - 100 Story Building Famous Google PuzzleShashank Nnoreply@blogger.comBlogger4125tag:blogger.com,1999:blog-5573456362841621035.post-26979988930307531072012-10-26T03:14:17.621-07:002012-10-26T03:14:17.621-07:00Thanks for the great post! I was asked this quest...Thanks for the great post! I was asked this question in an interview as well.<br /><br />This page also helped my understanding:<br /><br /><a href="http://www.programmerinterview.com/index.php/puzzles/2-eggs-100-floors-puzzle/" rel="nofollow">2 Eggs 100 Floors</a>Joehttps://www.blogger.com/profile/12568980537278420520noreply@blogger.comtag:blogger.com,1999:blog-5573456362841621035.post-106949527478654372012-10-04T17:24:40.405-07:002012-10-04T17:24:40.405-07:00Just a thought:
May be use EGG2 to identify block ...Just a thought:<br />May be use EGG2 to identify block of 10. That is test EGG2 to floor # 10, 20...100.<br />In worst case, it will require 10 attempts. Once it breaks at floor #100. Now we know the safe floor is between 91 and 99. <br /><br />Using EGG1 do linear search from 91 on wards. In worst case 9 more attempts. <br /><br /><b>Total attempts 19.</b>mandeep singhnoreply@blogger.comtag:blogger.com,1999:blog-5573456362841621035.post-78787950138019658012012-06-27T08:26:44.195-07:002012-06-27T08:26:44.195-07:00Simply we can try dropping an egg from even floors...Simply we can try dropping an egg from <b>even floors like 2,4,6 </b> if it breaks at any of these floor numbers then we can start testing with odd floor numbers like if egg breaks at <b>8th floor</b> then its understood that <i>now we have to go down so we can start with 7,5,3..1 .This way we can reduce the number of iterations</i>. And going further , we can also develop a generalized formula.Nishahttps://www.blogger.com/profile/08361978835071632742noreply@blogger.comtag:blogger.com,1999:blog-5573456362841621035.post-9964777692017439642012-06-27T03:15:41.309-07:002012-06-27T03:15:41.309-07:00If N is the number of storeys in the building opti...If N is the number of storeys in the building optimal answer is floor(sqrt(2*N)).<br />100-14.<br />200-20.Like that no need of this huge code my friend........donald yeshwanthhttps://www.blogger.com/profile/01932264046452045443noreply@blogger.com