Data Structure library for C / C++.
simple C implementations of various data structures, including sigle / double linked list, binary search tree, some balanced tree (red-black tree, AVL tree, splay tree), binary heap.
the motivation of this project is implementing data structure algorithm which has very efficient memory footprint by minimizing the node structure. for the sake of recursion, each node doesn't need to have pointer to parent. recursion is considered impractical due to its stack usage though, in case of balanced tree(like red-black tree / AVL tree) , however, it's possible to keep recursion depth in reasonable level. for example, red black tree requires only 2 kbytes at maximum when handling 2,000,000 nodes. node & root (or list item & list entry) can be used by inserting itself into another one (your own C struct). so it can be integrated easily into your design and doesn't necessarily depend on dyanmic memory allocation.
-
trees heavily depends on recursion
- splay tree (spltree)
- red black tree (nrbtree)
- AVL tree (avltree)
- hash tree (hashtree)
- binary heap (heap)
-
trees using recursion partially
- plain binary search tree (bstree)
-
there is no recursion usage in list family
- single-linked list
- double-linked list
GNU toolchain(gnu-arm-embedded) / clang / python / pip
-
release build (libcdsl.a libcdsl.so)
$> make config $> make release
-
unit testing
$> make config $> make test
python, pip, llvm, clang
gnu-arm-embedded
$> sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
$> sudo apt-get update
$> sudo apt-get install gcc-arm-embedded
-
release build (libcdsl.a libcdsl.so)
- for 32 bit machine
$ make config DEFCONF=x86_32
- for 64 bit machine
$ make config DEFCONF=x86_64
-
build library
$ make release
-
install them
$ sudo make install
-
clear configuration
$ make reset
BSD-2