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.
- #inspect ⇒ Object
- #to_a ⇒ Object
- #update_depth_and_balance ⇒ Object
Constructor Details
#initialize ⇒ EmptyNode
Returns a new instance of EmptyNode.
121 122 123 124 |
# File 'lib/binary_search_tree.rb', line 121 def initialize @depth = 0 @parent = nil end |
Instance Attribute Details
#depth ⇒ Object (readonly)
Returns the value of attribute depth.
118 119 120 |
# File 'lib/binary_search_tree.rb', line 118 def depth @depth end |
#parent ⇒ Object
Returns the value of attribute parent.
119 120 121 |
# File 'lib/binary_search_tree.rb', line 119 def parent @parent end |
Instance Method Details
#include? ⇒ Boolean
126 127 128 |
# File 'lib/binary_search_tree.rb', line 126 def include?(*) false end |
#inspect ⇒ Object
130 131 132 |
# File 'lib/binary_search_tree.rb', line 130 def inspect "{}" end |
#to_a ⇒ Object
134 135 136 |
# File 'lib/binary_search_tree.rb', line 134 def to_a [] end |
#update_depth_and_balance ⇒ Object
138 139 140 |
# File 'lib/binary_search_tree.rb', line 138 def update_depth_and_balance true end |