public void flatten1(Node root) {
        if(root==null)
            return;
        flatten(root.left);
        flatten(root.right);
        Node left  = root.left;
        Node right = root.right;
        root.left  = null;
        root.right = left;
        while(root.right!=null)
            root = root.right;
        root.right = right;
    }
Date 10/06/2016
@author Tushar Roy

Given a binary tree, flatten it to a linked list in-place in preorder traversal.

Time complexity O(n)

https://leetcode.com/problems/flatten-binary-tree-to-linked-list/
src/com/interview/tree/FlattenLinkListToBinaryTreePreorder.java