12
返回列表 发新帖
楼主: 低音探戈
跳转到指定楼层
上一主题 下一主题
收起左侧

amazon offer+面经, facebook面经(下周二还有电面)

🔗
jessica_led 2012-3-13 20:09:27 | 只看该作者
全局:
为啥感觉amazon一直比其他家多
回复

使用道具 举报

🔗
flyingman 2012-3-17 00:26:47 | 只看该作者
全局:
恭喜LZ啦!我得了CMU INI 和MISM的2012Fall的AD,正在犹豫去哪个呢。LZ知道哪个就业好些,能给点儿建议么?还有MISM有个背景调查是吧,INI也有么? 祝LZ多拿Offer!
回复

使用道具 举报

🔗
0864 2012-3-21 12:59:45 | 只看该作者
全局:
哈哈,来看题了。感谢分享面经。Facebook真心bug啊~
回复

使用道具 举报

🔗
列宾 2012-3-21 13:05:21 | 只看该作者
全局:
谢谢lz的面经哇!lz说的on campus面试是在pitts还是SV校区呀??
回复

使用道具 举报

🔗
danielgao 2012-3-21 14:40:08 | 只看该作者
全局:
求三个数和为零的那题转化成两个数和为指定值的方法?给跪了
ilovexiao77 发表于 2012-3-12 12:38


只知道n^2的做法

  1. 首先对数组A排序,从小到大
  2. for i = 0 to n-1
  3.   sum = -a[i]
  4.   start = 0, end = n -1;
  5.   while (start < end)
  6.     if a[start] + a[end] == -a[i]  and start != i and end !=i 则找到
  7.     if a[start] + a[end] > -a[i] --end;
  8.     else ++start
复制代码
回复

使用道具 举报

🔗
Siliya 2012-3-23 06:21:27 | 只看该作者
全局:
低音兄我来顶顶你的帖子。。。才看见。。才发现
回复

使用道具 举报

🔗
sunnyroom 2012-4-11 19:15:52 | 只看该作者
全局:
回复 9# newlxnewlx

薄熙来刚出事,你就换头像了。还挺迅速
回复

使用道具 举报

🔗
suzker 2012-9-27 03:47:09 | 只看该作者
全局:
danielgao 发表于 2012-3-21 14:40
只知道n^2的做法

输出一个数组里所有的和为0的三个数

如果能用额外空间的话,好像可以用hash table做:

====================================
1. use a double-loop to traverse the whole array, enumerate each possible pair of numbers, build up a hash table, use the sum values of the two numbers as the key, and the positions of the two numbers as the values. O(n^2) time, O(n) space

2. traverse the whole array once again, for each value, try to retrieve the positons from the hash table by the key of [current value minus by zero]... done! O(n)

total time complexity: O(n^2), w/ additional O(n) space.

====================================

similarily, sum two numbers into a certain value,

1. create a hash table, use each value of the numbers in the array as a key, then their positions as values. O(n) time w/ O(n) space
2. traverse the whole array once again, for each value, try to retrieve the positions from the hash table by the key of [certain value minus current value]... done. O(n) time

total: O(n) time w/ O(n) additional space..

======================================
回复

使用道具 举报

🔗
franciszz 2012-9-29 13:13:26 | 只看该作者
全局:
路过看看
回复

使用道具 举报

🔗
小民 2012-9-29 19:35:00 | 只看该作者
全局:
小弱拜读大作。
回复

使用道具 举报

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

本版积分规则

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