您的位置:首页 > Web前端 > Node.js

Leetcode 116, Populating Next Right Pointers in Each Node

2016-12-24 00:01 387 查看
public void connect(TreeLinkNode root) {
if(root == null){
return;
}
if(root.left != null){
root.left.next = root.right;
}
if(root.right != null){
if(root.next != null){
root.right.next = root.next.left;
}
}
connect(root.left);
connect(root.right);
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: