tree.hs 194 B

12345678
  1. -- Slide 29
  2. data BinaryTree = Leaf | Node Integer BinaryTree BinaryTree
  3. height bigTree = case bigTree of
  4. Leaf -> 0
  5. Node _ leftTree rightTree -> 1 + max (height leftTree) (height rightTree)