Give the type of a binary tree and an algorithm to compute its depth
Anonymous
type 'a tree = Leaf | Node of 'a * 'a tree * 'a tree let depth = function | Leaf -> 0 | Node (_, left, right) -> 1 + max (depth left) (depth right)
Check out your Company Bowl for anonymous work chats.