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! ✨