Advertisement
Guest User

Untitled

a guest
Nov 6th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
OCaml 0.19 KB | None | 0 0
  1. let rec isBalanced t = function
  2.     | Leaf -> true
  3.     | Node(t1,_,t2) -> isBalanced t1 &&
  4.                        isBalanced t2 &&
  5.                        abs(height t1 - height t2) <= 1;;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement