楼主: wrj5518
跳转到指定楼层
上一主题 下一主题
收起左侧

[CareerCup] 【第三轮】6.23-6.29 CareerCup 2.1

🔗
whiteflower 2014-7-4 20:25:05 | 只看该作者
全局:
【解题思路】
Insert each element into a hash table and check
the return value. If there has already a same
element in the hash table, delete the element
from the list
【时间复杂度】O(N)  O(N^2)
【空间复杂度】O(N)  O(1)
【gist link】https://gist.github.com/JoshuaTang/4aa47aa1696b0c184e8a
回复

使用道具 举报

🔗
Tsien 2014-7-6 23:51:19 | 只看该作者
全局:
//【解题思路】
//二重循环,第一重遍历链表,第二重找寻重复的元素
//【时间复杂度】
//O(n^2)
//【空间复杂度】
//O(1)
//【gist link】
https://gist.github.com/Tsien/2b657a0bc23f0ca63350
回复

使用道具 举报

🔗
pyemma 2014-7-7 21:11:27 | 只看该作者
全局:
habina 发表于 2014-6-23 14:04
Solution              : I am gonna sort the linked list first, and check value one by one, and reco ...

Using non-recursive version merge sort could obtain O(NlogN) time complexity without buffer storage I think.
回复

使用道具 举报

全局:
【解题思路】
w/ buffer: use a HashSet to note what values have already appeared
w/o buffer: two nested for loop

【时间复杂度】
w/ buffer: O(n)
w/o buffer: O(n^2)

【空间复杂度】
w/ buffer: O(n)
w/o buffer: O(1)

【gist link】
https://gist.github.com/happyWinner/18494e55f057c4070b74
回复

使用道具 举报

🔗
daisyang 2014-8-15 15:15:01 | 只看该作者
全局:
出去完了一个月,努力赶上啊 !!
https://gist.github.com/daisyang/5521dd686dcb792ff86d
回复

使用道具 举报

🔗
jaly50 2014-8-29 10:54:59 | 只看该作者
全局:
【解题思路】思路跟前面几楼差不多...因为参考了他们的!开始难起来啦 这个作业要写3个程序 2种方法!所以两个月以前我就弃疗了。。做到这题的时候TAT
【时间复杂度】
【空间复杂度】呃 不懂得算 为什么前面是n 后面是1
【gist link】 https://gist.github.com/jaly50/846c66d41e05c9985101
---------------OPTional,如果觉得test case比较好,欢迎写出来分享----------------------
【test case】Origin:[ 0 1 1 3 4 5 6 7 8 9 ]
Remove Duplicate without Buffer: [ 0 1 3 4 5 6 7 8 9 ]

Origin:[ 0 1 1 3 4 5 6 3 8 3 ]
Remove Duplicate with Buffer: [ 0 1 3 4 5 6 8 ]
回复

使用道具 举报

🔗
sanguine 2014-12-23 13:52:59 | 只看该作者
全局:
My Implementation:

http://www.jyuan92.com/post-427
回复

使用道具 举报

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

本版积分规则

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