Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- datatype 'a tree = Leaf of 'a | Node of 'a tree * 'a tree
- fun count p root =
- case root of
- Node(l,r) => (count p l)+(count p r)
- | Leaf leaf => if p leaf then 1 else 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement