class DSA::RedBlackTreeNode

Constants

BLACK
RED

Public Class Methods

new(key, value) click to toggle source
Calls superclass method DSA::BasicBinarySearchTreeNode::new
# File lib/DSA/binary_search_tree.rb, line 424
def initialize(key, value)
  super(key, value)
  @color = RED
end

Public Instance Methods

black?() click to toggle source
# File lib/DSA/binary_search_tree.rb, line 433
def black?
  @color == BLACK
end
red?() click to toggle source
# File lib/DSA/binary_search_tree.rb, line 429
def red?
  @color == RED
end
set_black!() click to toggle source
# File lib/DSA/binary_search_tree.rb, line 437
def set_black!
  @color = BLACK
end
set_red!() click to toggle source
# File lib/DSA/binary_search_tree.rb, line 441
def set_red!
  @color = RED
end