Class: EmptyNode

Inherits:
Object
  • Object
show all
Defined in:
lib/binary_search_tree.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeEmptyNode

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

#depthObject (readonly)

Returns the value of attribute depth.



143
144
145
# File 'lib/binary_search_tree.rb', line 143

def depth
  @depth
end

#parentObject

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

Returns:

  • (Boolean)


151
152
153
# File 'lib/binary_search_tree.rb', line 151

def include?(*)
  false
end

#insertObject



155
156
157
# File 'lib/binary_search_tree.rb', line 155

def insert(*)
  false
end

#inspectObject



159
160
161
# File 'lib/binary_search_tree.rb', line 159

def inspect
  "{}"
end

#recalculate_depth_and_balanceObject



163
164
165
# File 'lib/binary_search_tree.rb', line 163

def recalculate_depth_and_balance
  true
end

#to_aObject



167
168
169
# File 'lib/binary_search_tree.rb', line 167

def to_a
  []
end

#update_depth_and_balanceObject



171
172
173
# File 'lib/binary_search_tree.rb', line 171

def update_depth_and_balance
  true
end