Skip to content

artnum/rbtree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Red Black tree in C

An implementation of Red Black tree in C, inspired by PostgreSQL implementation.

Tree key can be set by defining macro, for example, RBTREE_KEY(name) uint32_t key[1] and RBTREE_KEY_BASE_TYPE uint32_t which would use 32 bits unsigned integer for the key. Use gcc argument to make that change : -D"RBTREE_KEY(name)"="uint32_t name[2]" -DRBTREE_KEY_BASE_TYPE="uint32_t". For simple value, like uint32_t as key, use uint32_t [1] or else it will segfault.

By default it is defined as uint64_t key[2] as it was originally designed to hold UUID.

Data part of a node is uintptr_t so it can hold either a integer or a pointer.

It implements basic operation : insert, search, delete, left most and right most. So it can be used for an in-memory index implementation.

About

An implementation of Red Black tree inspired from PostgreSQL implementation

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages