Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lvntky/ccontainer
Comprehensive STB style header-only library of data structures implemented in C
https://github.com/lvntky/ccontainer
b-tree binary-search-tree bloom-filter c99 collections containers data-structures doubly-linked-list dynamic-array graph hashmap heap linked-list priority-queue queue red-black-tree set stack trie
Last synced: 4 months ago
JSON representation
Comprehensive STB style header-only library of data structures implemented in C
- Host: GitHub
- URL: https://github.com/lvntky/ccontainer
- Owner: lvntky
- License: other
- Created: 2024-08-05T13:49:44.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2024-08-19T14:34:47.000Z (6 months ago)
- Last Synced: 2024-09-30T01:08:38.620Z (4 months ago)
- Topics: b-tree, binary-search-tree, bloom-filter, c99, collections, containers, data-structures, doubly-linked-list, dynamic-array, graph, hashmap, heap, linked-list, priority-queue, queue, red-black-tree, set, stack, trie
- Language: C
- Homepage: https://lvntky.github.io/ccontainer/
- Size: 666 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# CContainer
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/b38128bf0876489a91f2a8c420866aca)](https://app.codacy.com/gh/lvntky/ccontainer/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
![Codecov](https://img.shields.io/codecov/c/gh/lvntky/ccontainer)
![GitHub branch check runs](https://img.shields.io/github/check-runs/lvntky/ccontainer/master)CContainer is a comprehensive STB style header-only library of data structures implemented in C. This library provides a variety of container types that are essential for managing collections of data in C programs. Each container is designed to be efficient, easy to use, and flexible, making CContainer a valuable tool for C developers.
## Features
- Dynamic Array (Vector)
- Dynamic resizing
- Random access
- Efficient indexing
- Functions: Initialization, Insertion, Deletion, Access, Resizing, Cleanup-
- Linked List
- Dynamic size
- Efficient insertions/deletions at both ends
- Sequential access
- Functions: Initialization, Insertion, Deletion, Access, Cleanup-
- Doubly Linked List
- Dynamic size
- Efficient insertions/deletions at both ends
- Bidirectional sequential access
- Functions: Initialization, Insertion, Deletion, Access, Cleanup-
- Stack
- LIFO (Last In, First Out) access
- Functions: Initialization, Push, Pop, Peek, Cleanup-
- Queue
- FIFO (First In, First Out) access
- Functions: Initialization, Enqueue, Dequeue, Peek, Cleanup-
- Hash Map
- Key-value pair storage
- Efficient lookups, insertions, and deletions
- Functions: Initialization, Insert, Remove, Get, Cleanup-
- Set
- Unique element storage
- Efficient membership testing, insertion, and deletion
- Functions: Initialization, Insert, Remove, Contains, Cleanup-
- Binary Search Tree (BST)
- Ordered elements
- Efficient insertions, deletions, and lookups
- Functions: Initialization, Insertion, Deletion, Search, Traversal, Cleanup-
- Red-Black Tree
- Self-balancing BST
- Ensures balanced height for efficient operations
- Functions: Initialization, Insertion, Deletion, Search, Traversal, Cleanup-
- Heap (Priority Queue)
- Efficient retrieval of the maximum or minimum element
- Supports both max-heap and min-heap configurations
- Functions: Initialization, Insertion, Deletion, Peek, Cleanup-
- Graph
- Nodes and edges
- Supports directed and undirected graphs
- Functions: Initialization, Add node, Add edge, Remove node, Remove edge, Traversal, Cleanup-
- Trie (Prefix Tree)
- Efficient prefix-based search
- Useful for implementing dictionaries and autocomplete
- Functions: Initialization, Insertion, Deletion, Search, Cleanup-
- Bloom Filter
- Probabilistic data structure for set membership testing
- Space-efficient
- Functions: Initialization, Add, Query, Cleanup-
- B-Tree
- Balanced tree for efficient disk storage operations
- Used in databases and filesystems
- Functions: Initialization, Insertion, Deletion, Search, Traversal, Cleanup-## Building and installing
See the [BUILDING](BUILDING.md) document.
## Contributing
See the [CONTRIBUTING](CONTRIBUTING.md) document.
## Development Status
You can check and inform development and implementation status of containers from [DEVELOPMENT](DEVELOPMENT.md) document.
## Dependencies
By philosophy like many others of my libraries ccontainer does not depend any other third party libraries.
So you can directly clone/install ccontainer and start to use it.But if you want to run the unit tests from the /test directory, we are using [Unity](https://github.com/ThrowTheSwitch/Unity)
as our unit testing library. And initially we are using [conan](https://conan.io/) to download and use our dependencies
but you can use anything (installing Unity directly) you want.## Unit Test Coverage Graph Per File
![graph](https://codecov.io/gh/lvntky/ccontainer/graphs/tree.svg?token=0aUe4T51Su)## Licensing
This software is available under 2 [licenses](LICENSE) -- choose whichever you prefer.