Google classic interview questions, throwing eggs the least number of times All In One
Google classic interview questions, throwing eggs the least number of times All In One
谷歌经典面试题, 扔鸡蛋最少次数
14
✅
你在一栋 100 层的大楼里工作,你得到 2 个相同的鸡蛋。
你需要计算出鸡蛋可以掉落到最高的楼层而不破裂。
问题是你需要投掷多少次。
找到一种在最坏情况下最小化抛出次数的算法。
You work in a 100 floors building and you get 2 identical eggs.
You need to figure out the highest floor an egg can be dropped without breaking.
The question is how many throws you need to make.
Find an algorithm that is minimizing number of throws in the worst-case scenario.
LeetCode
https://leetcode.com/problems/super-egg-drop/
https://leetcode-cn.com/problems/super-egg-drop/
demos
(🐞 反爬虫测试!打击盗版⚠️)如果你看到这个信息, 说明这是一篇剽窃的文章,请访问 https://www.cnblogs.com/xgqfrms/ 查看原创文章!
The Two Egg Problem
https://code.oursky.com/famous-egg-dropping-puzzle-in-combinatorics/
https://medium.com/@khopsickle/2-eggs-and-100-floors-a032beb77aaa
http://datagenetics.com/blog/july22012/index.html
谷歌面试题: 扔鸡蛋
https://zhuanlan.zhihu.com/p/33898752
https://zhuanlan.zhihu.com/p/63953588
https://gist.github.com/sing1ee/5971946
https://juejin.cn/post/6877766729221537799
https://segmentfault.com/a/1190000016364846
https://juejin.cn/post/6995747344641687588
k+(k-1)+(k-2)+...+1>=100
k = 14
refs
©xgqfrms 2012-2021
www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!
原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!
本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/17644730.html
未经授权禁止转载,违者必究!