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.



121
122
123
124
# File 'lib/binary_search_tree.rb', line 121

def initialize
  @depth = 0
  @parent = nil
end

Instance Attribute Details

#depthObject (readonly)

Returns the value of attribute depth.



118
119
120
# File 'lib/binary_search_tree.rb', line 118

def depth
  @depth
end

#parentObject

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

Returns:

  • (Boolean)


126
127
128
# File 'lib/binary_search_tree.rb', line 126

def include?(*)
  false
end

#inspectObject



130
131
132
# File 'lib/binary_search_tree.rb', line 130

def inspect
  "{}"
end

#to_aObject



134
135
136
# File 'lib/binary_search_tree.rb', line 134

def to_a
  []
end

#update_depth_and_balanceObject



138
139
140
# File 'lib/binary_search_tree.rb', line 138

def update_depth_and_balance
  true
end