Inverse Tree function
def invertTree[A](tree: Tree[A]): Tree[A] = | |
fold (tree, Tree.empty[A]){(leftT, value, rightT) => Node(value, rightT, leftT)} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment