In School 42, almost every project must be written to comply with. coding standard (also known as the "Norm"). As a result, the implementation of certain parts may appear strange.
- Code documentation
- This is a library of assorted polymorphic data structures and their associated algorithms, implemented in C.
- Each data structure can work with an extensible range of data types. Such polymorphism is achieved with the use of void pointers at the expense of limited loss of type safety.
- Each data structure is initialized with an immutable
t_type
structure, containing pointers to functions required to work with a datatype (e.g. copy, delete, compare, hash etc). - The data structures implemented so far
- dynamic array
- doubly-linked list
- minimum priority queue
- maximum priority queue
- queue
- stack
- hashmap
- hashset
- binary search tree
- red-black tree
- union-find
- To compile the library, run
make
, includedata_structures.h
in your projects. - You can run unit tests with
make test
.
This code is inspired by the examples presented in both parts of an online course on Algorithms by Robert Sedgewick and Kevin Wayne. I am very grateful to them for creating such a wonderful resource and making it freely available to all.