class AtCoder::RedBlackTree
- AtCoder::RedBlackTree
- Reference
- Object
Included Modules
- Enumerable(Int32)
Defined in:
red_black_tree.crConstructors
Instance Method Summary
- #<<(x)
- #black_height(x = root)
- #delete(key)
- #delete_node(z)
-
#each(x = root, &)
Must yield this collection's elements to the block.
-
#empty?
Returns
true
ifself
is empty,false
otherwise. - #has_key?(key)
- #inorder_walk(x = root, &)
- #insert(key)
- #insert_node(x)
- #lower_than(key, x = root)
-
#max
Returns the element with the maximum value in the collection.
- #maximum_node(x = root)
-
#min
Returns the element with the minimum value in the collection.
- #minimum_node(x = root)
- #predecessor(x)
- #reverse_each(x = root, &)
- #reverse_inorder_walk(x = root, &)
- #root : Node
- #root=(root : Node)
- #search(key, x = root)
-
#size : Int32
Returns the number of elements in the collection.
- #size=(size : Int32)
- #successor(x)
Constructor Detail
Instance Method Detail
Must yield this collection's elements to the block.
Returns true
if self
is empty, false
otherwise.
([] of Int32).empty? # => true
([1]).empty? # => false
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.
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.
Returns the number of elements in the collection.
[1, 2, 3, 4].size # => 4