Class: Containers::CBst

### Home Classes Methods

### In Files

- ext/containers/bst/bst.c

### Parent

Object

### Methods

- ::new
- #[]=
- #delete
- #each
- #push
- #size

### Files

- Makefile
- Makefile
- Makefile
- Makefile
- Makefile

### Class/Module Index

Quicksearch

- Containers
- Containers::CBst
- Containers::CDeque
- Containers::CRBTreeMap
- Containers::CSplayTreeMap
- Containers::Heap
- Containers::KDTree
- Containers::MaxHeap
- Containers::MinHeap
- Containers::PriorityQueue
- Containers::Queue
- Containers::RubyDeque
- Containers::RubyDeque
- Containers::RubyRBTreeMap
- Containers::RubyRBTreeMap
- Containers::RubySplayTreeMap
- Containers::RubySplayTreeMap
- Containers::Stack
- Containers::SuffixArray
- Containers::Trie
- Object
- Object::Deque
- Object::RBTreeMap
- Object::SplayTreeMap
- Algorithms
- Algorithms::Search
- Algorithms::String

No matching classes.

# Containers::CBst

### Public Class Methods

new() click to toggle source

    static VALUE bst_initialize(VALUE self) {
            return self;
    }

### Public Instance Methods

[]=(p1, p2) click to toggle source
Alias for: push
delete(p1) click to toggle source

    static VALUE rb_bst_delete(VALUE self, VALUE key) {
            bst *tree = get_bst_from_self(self);
            bst_node *tobeDeleted = search_node(tree, tree->root, key);
            if(tobeDeleted) {
                    tree->size -= 1;
                    bst_node *deletedNode = delete_node(&(tree->root),tobeDeleted);
                    return deletedNode->value;
            }
            return Qnil;
    }

each() click to toggle source

    static VALUE rb_bst_each(VALUE self) {
            bst *tree = get_bst_from_self(self);
            bst_each(tree, &bst_each_helper, NULL);
            return self;
    }

push(p1, p2) click to toggle source

    static VALUE rb_bst_push_value(VALUE self, VALUE key, VALUE value) {
            bst *tree = get_bst_from_self(self);
            insert_element(tree, &(tree->root), create_node(key,value));
            tree->size++;
            return self;
    }

Also aliased as: []=
size() click to toggle source

    static VALUE rb_bst_size(VALUE self) {
            bst *tree;
            Data_Get_Struct(self,bst,tree);
            return INT2FIX(tree->size);
    }

[Validate]

Generated with the Darkfish Rdoc Generator 2.