Class: BSTNode
- Inherits:
-
Object
- Object
- BSTNode
- Defined in:
- lib/algorithm_selector.rb
Overview
Node helper class for Binary Search Tree
Instance Attribute Summary collapse
-
#left ⇒ Object
Returns the value of attribute left.
-
#right ⇒ Object
Returns the value of attribute right.
-
#val ⇒ Object
Returns the value of attribute val.
Instance Method Summary collapse
-
#initialize(val = nil, left = nil, right = nil) ⇒ BSTNode
constructor
A new instance of BSTNode.
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
#left ⇒ Object
Returns the value of attribute left.
582 583 584 |
# File 'lib/algorithm_selector.rb', line 582 def left @left end |
#right ⇒ Object
Returns the value of attribute right.
582 583 584 |
# File 'lib/algorithm_selector.rb', line 582 def right @right end |
#val ⇒ Object
Returns the value of attribute val.
582 583 584 |
# File 'lib/algorithm_selector.rb', line 582 def val @val end |