标签:inter amp ati art tno java int node log
public class Solution {
public void connect(TreeLinkNode root) {
TreeLinkNode startNode=root;
while(startNode!=null)
{
TreeLinkNode node=startNode;
while(node!=null)
{
if(node.left!=null)
node.left.next=node.right;
if(node.right!=null&&node.next!=null)
node.right.next=node.next.left;
node=node.next;
}
startNode=startNode.left;
}
}
}
116. Populating Next Right Pointers in Each Node
标签:inter amp ati art tno java int node log
原文地址:http://www.cnblogs.com/asuran/p/7613483.html