Class: BSTNode

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

Overview

Node helper class for Binary Search Tree

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(val = nil, left = nil, right = nil) ⇒ BSTNode

Returns a new instance of BSTNode.



583
584
585
586
587
# File 'lib/algorithm_selector.rb', line 583

def initialize(val=nil, left=nil, right=nil)
  @val = val
  @left = left
  @right = right
end

Instance Attribute Details

#leftObject

Returns the value of attribute left.



582
583
584
# File 'lib/algorithm_selector.rb', line 582

def left
  @left
end

#rightObject

Returns the value of attribute right.



582
583
584
# File 'lib/algorithm_selector.rb', line 582

def right
  @right
end

#valObject

Returns the value of attribute val.



582
583
584
# File 'lib/algorithm_selector.rb', line 582

def val
  @val
end