Advertisement
Guest User

Untitled

a guest
Aug 6th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Eiffel 0.37 KB | None | 0 0
  1.         high(cur: BINTREE): INTEGER
  2.             local
  3.                 h_left: INTEGER
  4.                 h_right: INTEGER
  5.             do
  6.                 if Current.value = Current.value.min_value then
  7.                     Result := 0
  8.                 else
  9.                     if cur.left /= Void then
  10.                         h_left := high(cur.left)
  11.                     end
  12.  
  13.                     if cur.right /= Void then
  14.                         h_right := high(cur.right)
  15.                     end
  16.  
  17.                     Result := h_left.max (h_right) + 1
  18.                 end
  19.             end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement