Advertisement
lukc93

Untitled

Oct 22nd, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. fun max(tree) =
  2. case tree of
  3. LEAF t => SOME t
  4. |NODE(n, p, d) => if n >= valOf(max(p)) andalso n >= valOf(max(d))
  5. then SOME n
  6. else if valOf(max(p)) > valOf(max(d))
  7. then max(p)
  8. else max(d)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement