Method: Containers::RubyRBTreeMap#height

Defined in:
lib/containers/rb_tree_map.rb

#heightObject

Return the height of the tree structure in the TreeMap.

Complexity: O(1)

map = Containers::TreeMap.new
map.push("MA", "Massachusetts")
map.push("GA", "Georgia")
map.height #=> 2


64
65
66
# File 'lib/containers/rb_tree_map.rb', line 64

def height
  @root and @root.height or 0
end