A complete, well-organized and documented collection of core and advanced data structures implemented in C, for both learning and interview preparation.
Each data structure is implemented in its own folder with:
*.cβ Implementation file*.hβ Header with declarations and structsmain.cβ Example/demo usageREADME.mdβ Description, operations, time/space complexitiesCMakeLists.txtβ Optional build file (per folder)
- Arrays (static/dynamic)
- Singly Linked List
- Doubly Linked List
- Circular Linked List
- Stack (Array & Linked List)
- Queue (Array & Linked List)
- Hash Tables (Chaining & Open Addressing)
- Set & Map via hashing
- Binary Tree
- Binary Search Tree
- AVL Tree
- Red-Black Tree
- Segment Tree
- B-Tree (Optional)
- Trie
- Min Heap
- Max Heap
- Priority Queue (with Heap)
- Adjacency List / Matrix
- BFS & DFS
- Dijkstraβs Algorithm
- Kruskalβs / Primβs (MST)
- Disjoint Set (Union-Find)
- Skip List
- K-D Tree
- Fenwick Tree (Binary Indexed Tree)
- Sparse Table
git clone https://github.com/Murchoid/data-structures-c.git
cd data-structures-cCompile and run (using Make or CMake):
cd singly_linked_list
make
./singly_linked_listOR
mkdir build && cd build
cmake ..
makeβ Testing Some folders include unit tests (using Check for C):
cd tests
make testπ€ Contributing We welcome contributions:
New data structures
Edge case handling
Code clean-up
Documentation
π Acknowledgments Inspired by CLRS and university-level DSA courses.
Big thanks to contributors and the open-source community.
β¨ Happy Coding and Learning! β¨