Class: BSTNode

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ BSTNode

Returns a new instance of BSTNode.


12
13
14
15
16
# File 'lib/binary_search_tree.rb', line 12

def initialize(value)
  @value = value
  @left = nil
  @right = nil
end

Instance Attribute Details

#leftObject

Returns the value of attribute left


10
11
12
# File 'lib/binary_search_tree.rb', line 10

def left
  @left
end

#rightObject

Returns the value of attribute right


10
11
12
# File 'lib/binary_search_tree.rb', line 10

def right
  @right
end

#valueObject

Returns the value of attribute value


10
11
12
# File 'lib/binary_search_tree.rb', line 10

def value
  @value
end