I first wrote the backbone for these data structure implementations in JavaScript while completing freeCodeCamp's Coding Interview Data Structure Challenges. Since then, I've ported my JavaScript code to TypeScript (limited to ES5 libraries), Python, and C, and added a few additional features.
I've found C to be the most fun (and certainly the most educational) language to build these in. I also wrote custom (but informal) tests for my C implementations in the main
function of each file.
Please enjoy, and let me know if you have any questions!
- Stack
- Queue
- Priority queue
- Circular queue
- Linked list
- Doubly-linked list
- Hash table
- Set
set.c
set.ts
- Python has had a built-in set type since 2004.
- Binary search tree
- Trie search tree
- Max heap
- Min heap