Class: DSA::BinarySearchTree::Node

Inherits:
Struct
  • Object
show all
Defined in:
lib/dsa-ruby/binary_search_tree.rb

Overview

Internal node structure for the binary search tree.

Instance Attribute Summary collapse

Instance Attribute Details

#leftNode?

Returns the left child node.

Returns:

  • (Node, nil)

    the left child node



25
# File 'lib/dsa-ruby/binary_search_tree.rb', line 25

Node = Struct.new(:val, :left, :right, keyword_init: true)

#rightNode?

Returns the right child node.

Returns:

  • (Node, nil)

    the right child node



25
# File 'lib/dsa-ruby/binary_search_tree.rb', line 25

Node = Struct.new(:val, :left, :right, keyword_init: true)

#valComparable

Returns the value stored in the node.

Returns:

  • (Comparable)

    the value stored in the node



25
# File 'lib/dsa-ruby/binary_search_tree.rb', line 25

Node = Struct.new(:val, :left, :right, keyword_init: true)