Method: Containers::RubySplayTreeMap#height
- Defined in:
- lib/containers/splay_tree_map.rb
#height ⇒ Object
Return the height of the tree structure in the SplayTreeMap.
Complexity: O(log n)
map = Containers::SplayTreeMap.new
map.push("MA", "Massachusetts")
map.push("GA", "Georgia")
map.height #=> 2
112 113 114 |
# File 'lib/containers/splay_tree_map.rb', line 112 def height height_recursive(@root) end |