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

[CareerCup] 【第三轮】7.7-7.13 CareerCup 4.4

🔗
wilbert 2014-7-14 06:00:07 | 只看该作者
全局:
【解题思路】
Level Order Traversal
【时间复杂度】
O(N)
【空间复杂度】
O(N)
【gist link】
https://gist.github.com/iwilbert/656493ac191d0a3d6abe
回复

使用道具 举报

🔗
wilbert 2014-7-14 06:00:15 | 只看该作者
全局:
【解题思路】
Level Order Traversal
【时间复杂度】
O(N)
【空间复杂度】
O(N)
【gist link】
https://gist.github.com/iwilbert/656493ac191d0a3d6abe
回复

使用道具 举报

🔗
jyh橘子 2014-7-16 05:41:29 | 只看该作者
全局:
【解题思路】
1.  modified pre_order traversal, recursive method
2. BTS
【时间复杂度】
1. O(N)
2. O(N)
【空间复杂度】
1. O(N)    + O(lgN)for recursion
2. O(N)
【gist link】
https://gist.github.com/jyhjuzi/f8cfddb8a198180d17f9
回复

使用道具 举报

🔗
林微熙 2014-7-16 06:21:23 | 只看该作者
全局:
【解题思路】BFS
【时间复杂度】O(N)
【空间复杂度】O(N)
【gist link】https://gist.github.com/hilda8519/d88070153f559a4d5c47
回复

使用道具 举报

🔗
renli3000 2014-7-18 05:34:26 | 只看该作者
全局:
【解题思路】简单暴力的BFS + 双queue存储, 和leetcode上一道题类似
【时间复杂度】O(N)
【空间复杂度】O(N)
【gist link】https://gist.github.com/Noahsark/95b8e7ecfc5b21e14923
回复

使用道具 举报

🔗
tonygxxx1212 2014-7-19 22:25:31 | 只看该作者
全局:
【解题思路】BFS - list of list to store, no need for queue and visit flag (binary tree has no circle)
【时间复杂度】O(N)
【空间复杂度】O(N)
【gist link】https://gist.github.com/xun-gong/3014fdabc864b4b2302e
回复

使用道具 举报

🔗
jason51122 2014-7-27 12:02:12 | 只看该作者
全局:
【解题思路】Level order traversal
【时间复杂度】O(N)
【空间复杂度】O(N)
【gist link】https://gist.github.com/jason51122/f22ed431db4a7dd8fbf3
回复

使用道具 举报

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

本版积分规则

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