class RedBlack::Tree(V)

Included Modules

Defined in:

rb_tree.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new #

[View source]
def self.new(&smaller : V, V -> Bool) #

[View source]

Instance Method Detail

def <<(v : V) #

[View source]
def collect #

[View source]
def depth(x : Node(V) | Leaf) #

[View source]
def display(io : IO, h) #

[View source]
def display #

[View source]
def each(&) #
Description copied from module Enumerable(V)

Must yield this collection's elements to the block.


[View source]
def each_node(&) #

[View source]
def each_node_with_index(&) #

[View source]
def empty! #

[View source]
def empty? #
Description copied from module Enumerable(V)

Returns true if self is empty, false otherwise.

([] of Int32).empty? # => true
([1]).empty?         # => false

[View source]
def enum(&) #

[View source]
def find(key : V) #

[View source]
def find!(key : V) #

[View source]
def find?(key : V) #

[View source]
def height(x : Node(V) | Leaf) #

[View source]
def insert(v : V) #

[View source]
def max_node #

[View source]
def max_node! #

[View source]
def max_node? #

[View source]
def min_node #

[View source]
def min_node! #

[View source]
def min_node? #

[View source]
def pred(x : Node(V)) #

[View source]
def pred!(x : Node(V)) #

[View source]
def pred?(x : Node(V)) #

[View source]
def size #
Description copied from module Enumerable(V)

Returns the number of elements in the collection.

[1, 2, 3, 4].size # => 4

[View source]
def succ(x : Node(V)) #

[View source]
def succ!(x : Node(V)) #

[View source]
def succ?(x : Node(V)) #

[View source]
def to_s(io) #

[View source]