Class: BinaryTreeNode
- Inherits:
-
Object
- Object
- BinaryTreeNode
- Defined in:
- lib/data_structures/binary_tree.rb
Instance Method Summary collapse
-
#initialize(val = nil, parent = nil, left_child = nil, right_child = nil) ⇒ BinaryTreeNode
constructor
A new instance of BinaryTreeNode.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(val = nil, parent = nil, left_child = nil, right_child = nil) ⇒ BinaryTreeNode
Returns a new instance of BinaryTreeNode.
69 70 71 72 73 74 |
# File 'lib/data_structures/binary_tree.rb', line 69 def initialize(val=nil, parent=nil, left_child=nil, right_child=nil) @val = val @parent = parent @left_child = left_child @right_child = right_child end |
Instance Method Details
#inspect ⇒ Object
80 81 82 |
# File 'lib/data_structures/binary_tree.rb', line 80 def inspect @val end |
#to_s ⇒ Object
76 77 78 |
# File 'lib/data_structures/binary_tree.rb', line 76 def to_s @val end |