查看: 5263| 回复: 9
跳转到指定楼层
上一主题 下一主题
收起左侧

[实习] 被amazon拒了

头像被屏蔽
提示: 作者被禁止或删除 内容自动屏蔽

上一篇:Amazon Intern offer
下一篇:Summer Intern @ MathWorks + EE PhD找实习小结 + 求室友
🔗
右手握笔 2013-3-2 08:36:51 | 只看该作者
全局:
patpat, 悲剧的都躲起来了吧T T
回复

使用道具 举报

🔗
eallanwong 2013-3-3 09:00:25 | 只看该作者
全局:
一面的第二题2 sum是什么意思?
回复

使用道具 举报

🔗
qianmao 2013-3-3 10:29:09 | 只看该作者
全局:
eallanwong 发表于 2013-3-3 09:00
一面的第二题2 sum是什么意思?

就是一个array里 求出sum是一个给定值的两个数位置
比如0, 1, 2, 3, 4, 5,sum = 4,.--
则为(0,4), (1,3)
回复

使用道具 举报

🔗
blactangeri 2013-3-3 15:16:28 | 只看该作者
全局:
patpat, 、
回复

使用道具 举报

🔗
marstorm08 2013-3-4 02:41:50 | 只看该作者
全局:
同杯具。。话说 求树高那道题我也被问到了
回复

使用道具 举报

🔗
johnwan 2013-3-4 08:26:47 | 只看该作者
全局:
被拒的多了吧。。反正我也被拒了。
回复

使用道具 举报

🔗
owl 2013-3-21 04:50:29 | 只看该作者
全局:
+1 悲剧,而且我觉得自己答的还行,题都写出来了。估计有bug所以
回复

使用道具 举报

🔗
dennyrong 2013-3-21 06:14:28 | 只看该作者
全局:
楼主好厉害,我连amazon的面试都没有

回复

使用道具 举报

🔗
paradox 2013-3-21 06:47:01 | 只看该作者
全局:
本帖最后由 paradox 于 2013-3-21 06:48 编辑

for any type of tree, u can use a BFS with node class that has an addtional size field.. From 1point 3acres bbs
public Class Node
{
int data;
int height;
//any sort of way to point to its children
//can be array of objects
//ex. Node[] children;
.--
//constrcutor etc.... ----
}

public static int height (Node root)
{
Queue<Node> q = Queue<Node>();
Node lastnode;

root.height = 0;//set height of the root as 0
q.enqueue(root);
.--
while(!q.isEmpty())
{
   lastnode = q.dequeue();
   for(Node n : lastnode.childen ). 1point3acres.com
  {
     if(n !== null);
     {
        n.height = lastnode.height + 1
        q.enqueue(n);
     }
  }

}. 1point3acres.com
return lastnode.height; //this will return a 0-based height
}

回复

使用道具 举报

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

本版积分规则

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