Advertisement
Guest User

Untitled

a guest
Jun 19th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. datatype 'a tree = Leaf of 'a | Node of 'a tree * 'a tree
  2.  
  3. fun count p root =
  4. case root of
  5. Node(l,r) => (count p l)+(count p r)
  6. | Leaf leaf => if p leaf then 1 else 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement