Skip to content

Instantly share code, notes, and snippets.

Last active August 29, 2015 14:23
What would you like to do?
size of the tree
def size[T] (tree: Tree[T]) =
fold(tree, 0: Int){(l,x,r) => l + r + 1}
scala> size(t1)
res11: Int = 7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment