Created
December 4, 2016 02:17
-
-
Save wkimeria/6bef68acae97e83d00c586eaa5585627 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def maximum(tr: Tree[Int]): Int = tr match{ | |
case Leaf(v) => v | |
case Branch(l,r) => maximum(l) max maximum(r) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment