Method: WindingPolygon::AVLNode#update_height
- Defined in:
- lib/winding-polygon/avltree.rb
#update_height ⇒ Object
170 171 172 173 174 175 |
# File 'lib/winding-polygon/avltree.rb', line 170 def update_height l_height = @left.nil? ? 0 : @left.height r_height = @right.nil? ? 0 : @right.height @height = ((l_height > r_height) ? l_height : r_height) + 1 @parent.update_height unless @parent.nil? end |