Class: AVLTree::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-avl/node.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Node

Returns a new instance of Node.



5
6
7
8
9
# File 'lib/ruby-avl/node.rb', line 5

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

Instance Attribute Details

#dataObject

Returns the value of attribute data.



3
4
5
# File 'lib/ruby-avl/node.rb', line 3

def data
  @data
end

#leftObject

Returns the value of attribute left.



3
4
5
# File 'lib/ruby-avl/node.rb', line 3

def left
  @left
end

#rightObject

Returns the value of attribute right.



3
4
5
# File 'lib/ruby-avl/node.rb', line 3

def right
  @right
end