Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- high(cur: BINTREE): INTEGER
- local
- h_left: INTEGER
- h_right: INTEGER
- do
- if Current.value = Current.value.min_value then
- Result := 0
- else
- if cur.left /= Void then
- h_left := high(cur.left)
- end
- if cur.right /= Void then
- h_right := high(cur.right)
- end
- Result := h_left.max (h_right) + 1
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement