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.
59 60 61 62 63 64 |
# File 'lib/data_structures/binary_tree.rb', line 59 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
70 71 72 |
# File 'lib/data_structures/binary_tree.rb', line 70 def inspect @val end |
#to_s ⇒ Object
66 67 68 |
# File 'lib/data_structures/binary_tree.rb', line 66 def to_s @val end |