C Algorithms Library
The C programming language includes a very limited standard library in comparison to other modern programming languages. This is a collection of common Computer Science data structures and algorithms which may be used in C projects.
The code is licensed under the ISC license (a simplified version of the BSD license that is functionally identical). As such, it may be reused in any project, whether Proprietary or Open Source.
- ArrayList : Automatically resizing array.
- Doubly linked list : A set of values stored in a list with links that point in both directions.
- Singly linked list : A set of values stored in a list with links that point in one direction.
- Queue : Double ended queue which can be used as a FIFO or a stack.
- Set : Unordered set of values.
- Bloom Filter : Space-efficient set.
- Hash table : Collection of values which can be addressed using a key.
- Trie : Fast mapping using strings as keys.
- AVL tree : Balanced binary search tree with O(log n) worst case performance.
All of the above data structures operate on void pointers. It is sometimes necessary to compare values (when sorting a list, for example) or generate a hash key (in a hash table or set). This is done by providing a pointer to a function which provides this functionality. The following functions provide this functionality for some common data types.