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

[CareerCup] [第二轮] 2/25-3/3 CareerCup 2.5

🔗
 楼主| Fanyare 2013-3-1 06:10:05 | 只看该作者
全局:
https://github.com/quantumrose/C ... r/2.5.AddLists.java
forward: pad zeros in front of shorter list
回复

使用道具 举报

🔗
lazyGoose 2013-3-1 09:15:15 | 只看该作者
全局:
https://gist.github.com/lazyGoose/5061684
reverseOrlder, calculate each sum, and create a sumNode, add the every result.

I am here to copy the second solution :)
回复

使用道具 举报

🔗
weep_willow 2013-3-1 12:25:36 | 只看该作者
全局:
* Problem 2.5: add two numbers in the list
* Solution: add it up one digit by digit, indicate the carry digit, if one list is ended, fill 0; insert the sum to the tail of the list
* Follow up: use stacks to store the list, and then same strategy as above, only thing to pay attention is this time, the sum result should be insert from the head of the list.

c/c++实现

https://github.com/StanleyLee/CareerCup/blob/master/2_5.cpp
回复

使用道具 举报

🔗
champoier 2013-3-2 14:06:27 | 只看该作者
全局:
直接一位一位加

follow up:
先比较位数,不一样长,在头补零,然后再用递归相加

https://gist.github.com/skxie/8cbafe1200d970f50aa5
回复

使用道具 举报

🔗
cjsp 2013-3-2 15:07:10 | 只看该作者
全局:
https://gist.github.com/flatlight/5069988
链表版的高精度算法
第二题直接reverse了。。不过应该不是interviewer想要的答案,回头再写一下padding zero的方法
回复

使用道具 举报

🔗
ThunderXu 2013-3-2 20:09:11 | 只看该作者
全局:
https://gist.github.com/ThunderXu/5070704
Backward. Add nums and save the answer to a new list, add carry if it is necessary.
Forward. Calculate the diff of digits first and add nums, save answer to a new list, use recursion to ensure that a digit can get the number of carry from latter digits when calculation.
回复

使用道具 举报

🔗
Kimurate 2013-3-3 09:24:23 | 只看该作者
全局:
看了大家的方法,感覺我的這個很不靠譜,不能計算大數的加法,以後再改改。
* Method: Get the values from list, add them, create a list from the summary.
* FOLLOW UP: Vice versa.
C Language:
https://gist.github.com/hukun01/5074045

回复

使用道具 举报

回复

使用道具 举报

🔗
seasonxcc 2013-4-3 13:24:06 | 只看该作者
全局:
https://gist.github.com/

this is my sol
回复

使用道具 举报

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

本版积分规则

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