Invert Binary Tree

^_^


    public TreeNode invertBT(TreeNode root){
        if(root != null) {
            TreeNode tmp = invertBT(root.left);
            root.left = invertBT(root.right);
            root.right = tmp;
        }
        return root;
    }

results matching ""

    No results matching ""