Class: EmptyNode
- Inherits:
-
Object
- Object
- EmptyNode
- Defined in:
- lib/binary_search_tree.rb
Instance Attribute Summary collapse
-
#depth ⇒ Object
readonly
Returns the value of attribute depth.
-
#parent ⇒ Object
Returns the value of attribute parent.
Instance Method Summary collapse
- #include? ⇒ Boolean
-
#initialize ⇒ EmptyNode
constructor
A new instance of EmptyNode.
- #insert ⇒ Object
- #inspect ⇒ Object
- #recalculate_depth_and_balance ⇒ Object
- #to_a ⇒ Object
- #update_depth_and_balance ⇒ Object
Constructor Details
#initialize ⇒ EmptyNode
Returns a new instance of EmptyNode.
146 147 148 149 |
# File 'lib/binary_search_tree.rb', line 146 def initialize @depth = 0 @parent = nil end |
Instance Attribute Details
#depth ⇒ Object (readonly)
Returns the value of attribute depth.
143 144 145 |
# File 'lib/binary_search_tree.rb', line 143 def depth @depth end |
#parent ⇒ Object
Returns the value of attribute parent.
144 145 146 |
# File 'lib/binary_search_tree.rb', line 144 def parent @parent end |
Instance Method Details
#include? ⇒ Boolean
151 152 153 |
# File 'lib/binary_search_tree.rb', line 151 def include?(*) false end |
#insert ⇒ Object
155 156 157 |
# File 'lib/binary_search_tree.rb', line 155 def insert(*) false end |
#inspect ⇒ Object
159 160 161 |
# File 'lib/binary_search_tree.rb', line 159 def inspect "{}" end |
#recalculate_depth_and_balance ⇒ Object
163 164 165 |
# File 'lib/binary_search_tree.rb', line 163 def recalculate_depth_and_balance true end |
#to_a ⇒ Object
167 168 169 |
# File 'lib/binary_search_tree.rb', line 167 def to_a [] end |
#update_depth_and_balance ⇒ Object
171 172 173 |
# File 'lib/binary_search_tree.rb', line 171 def update_depth_and_balance true end |