@@ -0,0 +1,845 @@
+/**%0A * Definition for binary tree with next pointer.%0A * public class TreeLinkNode %7B%0A *     int val;%0A *     TreeLinkNode left, right, next;%0A *     TreeLinkNode(int x) %7B val = x; %7D%0A * %7D%0A */%0Apublic class Solution %7B%0A    public void connect(TreeLinkNode root) %7B%0A        TreeLinkNode parent = root;%0A        if(parent != null)%7B%0A        %0A%09    %09TreeLinkNode child = parent.left;%0A%09    %09TreeLinkNode leftmostchild = child;%0A%09    %09%0A%09    %09while(leftmostchild != null)%7B%0A%09    %09%09if(child == parent.left)%7B%0A%09    %09%09%09child.next = parent.right;%0A%09    %09%09%7D%0A%09    %09%09else%7B%0A%09    %09%09%09parent = parent.next;%0A%09    %09%09%09if(parent != null)%7B%0A%09    %09%09%09%09child.next = parent.left;%0A%09    %09%09%09%7D%0A%09    %09%09%7D%0A%09    %09%09child = child.next;%0A%09    %09%09%0A%09    %09%09if(child == null)%7B%0A%09    %09%09%09parent = leftmostchild;%0A%09    %09%09%09child = parent.left;%0A%09    %09%09%09leftmostchild = child;%0A%09    %09%09%7D%0A%09    %09%7D%0A        %7D%0A    %7D%0A%7D%0A

Create PopulNxtRhtPnterinEachNode_001.java