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

A家intern 第三轮 3天没给回是不是就是挂了。。。。(含面经)

🔗
 楼主| kirone 2013-1-30 10:52:42 | 只看该作者
全局:
jwzxgo 发表于 2013-1-30 04:42
多谢 LZ 分享 copy the old tree 这个是什么意思哈?

其实我那时候更糊涂,不过我觉得应该是这个意思:
Writing down the implementation of the algorithm that does a copy of a binary search tree seems to be a task preferred by certain interviewers. Doing this task properly requires an understanding of both the tree traversal and referencing in Java. However, doing this task properly also requires only few lines of code (if done recursively). That said, I've included below the implementation of the algorithm that copies a binary search tree in O(n) runtime complexity (it can't get faster than that, as you have to traverse and copy all the nodes, don't you?). Here yo go:

然后code 是
public static Node copy( Node node ) {
        if( node == null ) {
            return null;
        } else {
            Node newNode = new Node( node.data );
            newNode.left = copy( node.left );
            newNode.right = copy( node.right );
            return newNode;
        }
    }
回复

使用道具 举报

🔗
 楼主| kirone 2013-1-30 10:52:55 | 只看该作者
全局:
咪崽 发表于 2013-1-30 09:29
发现不都难诶....

我也赶紧投个简历试一下....

必须的!加油哇
回复

使用道具 举报

🔗
 楼主| kirone 2013-1-30 10:53:06 | 只看该作者
全局:
zhuniuniu 发表于 2013-1-30 09:47
lz加油!希望你有好的结果!

多谢多谢~~
回复

使用道具 举报

🔗
 楼主| kirone 2013-1-30 10:53:39 | 只看该作者
全局:
潜水被 发表于 2013-1-30 04:29
虽然我只面了2轮 但是等了2周才有回信的 所以不要着急

感觉我之前搞砸了一个,让人口述code 的,最烦那种了。。
回复

使用道具 举报

🔗
 楼主| kirone 2013-1-30 10:54:00 | 只看该作者
全局:
johnwan 发表于 2013-1-30 04:26
我等了一个多星期呢,你要被录了下半年要推我啊哈哈。。

不敢当不敢当。一定一定
回复

使用道具 举报

🔗
xiaoma318 2013-1-30 14:10:50 | 只看该作者
全局:
Thx for sharing experience, i'll also take a third interview in Feb, God bless me~
回复

使用道具 举报

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

本版积分规则

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