<
回复: 3
收起左侧

APT校园面面经

本楼:   👍  0
0%
0%
0   👎
全局:   4
100%
0%
0

2017(10-12月) 码农类General 硕士 全职@APT - 校园招聘会 - 校园招聘会  | Other | 应届毕业生

注册一亩三分地论坛,查看更多干货!

您需要 登录 才可以下载或查看附件。没有帐号?注册账号

x
                                                              /**  第一次发帖+第一次one on one interview  **/


first half 问简历:
为什么学cs, 喜欢什么方向, 实习干的啥, 最喜欢的项目是啥, 有没有什么项目别人分派给你结果出于兴趣或其他你又做了多余的深入挖掘。。。
从来没有被问过这么多没有用的问题

second half minStack:<
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限查看其他获取积分的方式
ge/smiley/QQ/em43.gif" smilieid="120" border="0" alt="" />



上一篇:卖力 电面
下一篇:亚麻欧A🐰
hanscat2018 2017-10-13 02:48:40 | 显示全部楼层
本楼:   👍  0
0%
0%
0   👎
全局:   1264
53%
47%
1119
楼主这个有0(1) space O(1) time的解的。
http://www.geeksforgeeks.org/design-a-stack-that-supports-getmin-in-o1-time-and-o1-extra-space/

Push(x) : Inserts x at the top of stack.
        If stack is empty, insert x into the stack and make minEle equal to x.
        If stack is not empty, compare x with minEle. Two cases arise:
        If x is greater than or equal to minEle, simply insert x.
        If x is less than minEle, insert (2*x – minEle) into the stack and make minEle equal to x. For example, let previous minEle was 3. Now we want to insert 2. We update minEle as 2 and insert 2*2 – 3 = 1 into the stack.
Pop() : Removes an element from top of stack.
        Remove element from top. Let the removed element be y. Two cases arise:
        If y is greater than or equal to minEle, the minimum element in the stack is still minEle.
        If y is less than minEle, the minimum element now becomes (2*minEle – y), so update (minEle = 2*minEle – y). This is where we retrieve previous minimum from current minimum and its value in stack. For example, let the element to be removed be 1 and minEle be 2. We remove 1 and update minEle as 2*2 – 1 = 3.
回复

使用道具 举报

 楼主| Topirene 2017-10-27 05:22:54 | 显示全部楼层
本楼:   👍  0
0%
0%
0   👎
全局:   4
100%
0%
0

sorry。。没后续了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号
隐私提醒:
  • ☑ 禁止发布广告,拉群,贴个人联系方式:找人请去🔗同学同事飞友,拉群请去🔗拉群结伴,广告请去🔗跳蚤市场,和 🔗租房广告|找室友
  • ☑ 论坛内容在发帖 30 分钟内可以编辑,过后则不能删帖。为防止被骚扰甚至人肉,不要公开留微信等联系方式,如有需求请以论坛私信方式发送。
  • ☑ 干货版块可免费使用 🔗超级匿名:面经(美国面经、中国面经、数科面经、PM面经),抖包袱(美国、中国)和录取汇报、定位选校版
  • ☑ 查阅全站 🔗各种匿名方法

本版积分规则

Advertisement
>
快速回复 返回顶部 返回列表