AtCoder::RedBlackTree
Inherits Enumerable / Reference / Object
Constructors
new
SourceInstance methods
<<(x)
Sourceblack_height(x = root)
Sourcedelete(key)
Sourcedelete_node(z)
Sourceempty?
Returns true if self does not contain any element.
([] of Int32).empty? # => true
([1]).empty? # => false
[nil, false].empty? # => false
#present?returns the inverse.
has_key?(key)
Sourceinorder_walk(x = root, &)
Sourceinsert(key)
Sourceinsert_node(x)
Sourcelower_than(key, x = root)
Sourcemax
Returns the element with the maximum value in the collection.
It compares using > so it will work for any type that supports that method.
[1, 2, 3].max # => 3
["Alice", "Bob"].max # => "Bob"
Raises Enumerable::EmptyError if the collection is empty.
maximum_node(x = root)
Sourcemin
Returns the element with the minimum value in the collection.
It compares using < so it will work for any type that supports that method.
[1, 2, 3].min # => 1
["Alice", "Bob"].min # => "Alice"
Raises Enumerable::EmptyError if the collection is empty.
minimum_node(x = root)
Sourcepredecessor(x)
Sourcereverse_each(x = root, &)
Sourcereverse_inorder_walk(x = root, &)
Sourceroot
Sourceroot=(root : Node)
Sourcesearch(key, x = root)
Sourcesize=(size : Int32)
Sourcesuccessor(x)
Source