2019-07-10 20:58:38 -04:00
2019-04-30 03:23:35 -04:00
2019-07-10 20:58:38 -04:00
2019-06-09 00:30:30 -04:00
2019-04-30 03:23:35 -04:00
2019-04-28 22:56:17 -05:00
2019-04-28 22:56:17 -05:00
2019-06-23 17:43:18 -04:00
2019-06-23 17:43:18 -04:00
2019-07-10 20:58:38 -04:00
2019-04-28 22:56:17 -05:00
2019-05-05 11:27:51 -04:00
2019-06-23 17:43:18 -04:00

CircleCI Documentation Codecov Codacy Language License

Containers

This library provides various containers. Each container has utility functions to manipulate the data it holds. This is an abstraction as to not have to manually manage and reallocate memory.

Inspired by the C++ standard library; however, implemented using C with different function interfaces as the C++ standard library but with the same container names.

Setup

The build.sh script can be used to build either dynamic or static libraries. The script supports clang and gcc.

The benefit of a dynamic library is that changing the containers.so library can be done without needing to recompile the codebase which is using the library. Nevertheless, it is slower than a static library.

The benefit of a static library is that it is faster than a dynamic library. However, if the containers.a library is modified, the codebase which is using the library needs to be recompiled.

The installation process is as follows:

  1. Clone this repository and navigate to it.
  2. Run the build.sh build script.
  3. Follow the instructions that the script prints.

Container Types

The container types that this library contains are described below.

Sequence containers

Data structures which can be accessed sequentially.

  • array - static contiguous array
  • vector - dynamic contiguous array
  • deque - double-ended queue
  • forward_list - singly-linked list
  • list - doubly-linked list

Associative containers

Data structures that can be quickly searched which use comparators.

  • set - collection of unique keys, sorted by keys
  • map - collection of key-value pairs, sorted by keys, keys are unique
  • multiset - collection of keys, sorted by keys
  • multimap - collection of key-value pairs, sorted by keys

Unordered associative containers

Data structures that can be quickly searched which use hashing.

  • unordered_set - collection of unique keys, hashed by keys
  • unordered_map - collection of key-value pairs, hashed by keys, keys are unique
  • unordered_multiset - collection of keys, hashed by keys
  • unordered_multimap - collection of key-value pairs, hashed by keys

Container adaptors

Data structures which adapt other containers to enhance functionality.

  • stack - adapts a container to provide stack (last-in first-out)
  • queue - adapts a container to provide queue (first-in first-out)
  • priority_queue - adapts a container to provide priority queue
Description
This library provides various containers. Each container has utility functions to manipulate the data it holds. This is an abstraction as to not have to manually manage and reallocate memory.
Readme MIT 1.2 MiB
Languages
C 99.5%
Python 0.3%
Makefile 0.2%