Tuesday, December 15, 2015

Create a Mirror Copy of a Binary Tree

    public BinaryTree MirorCopyOfTree(BinaryTree T)    {
        BinaryTree newTree = new BinaryTree(T.data);
        if(T.left!=null)
            newTree.right=MirorCopyOfTree(T.left);
        if(T.right!=null)
            newTree.left=MirorCopyOfTree(T.right);
        return newTree;
    }
UA-39217154-2