Skip to content

Instantly share code, notes, and snippets.

@adilakhter
Last active August 29, 2015 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adilakhter/fd04881098f62c11e388 to your computer and use it in GitHub Desktop.
Save adilakhter/fd04881098f62c11e388 to your computer and use it in GitHub Desktop.
InvertTree scala repl output
scala> invertTree(t1)
res12: Tree[Int] =
Node(4,
Node(7,
Node(9,EmptyTree,EmptyTree),
Node(6,EmptyTree,EmptyTree)),
Node(2,
Node(3,EmptyTree,EmptyTree),
Node(1,EmptyTree,EmptyTree)))
/*
4
/ \
7 2
/ \ / \
9 6 3 1
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment