This repository contains implementations of classic data structures in Python, including lists, stacks, queues, trees, and graphs.
It's designed as a personal reference and educational toolkit, with clean modular code and unit tests for each structure.
βοΈ Built from scratch without external libraries β focused on core logic and algorithmic clarity.
data_structures/
βββ graphs/
β βββ directed_graph.py
β βββ flow_network.py
βββ lists/
β βββ single_linked_list.py
β βββ doubly_linked_list.py
βββ stacks_and_queues/
β βββ stack.py
β βββ queue.py
β βββ deque.py
βββ trees/
βββ binary_tree.py
βββ binary_search_tree.py
tests/
βββ test_lists/
βββ tests_stacks_and_queues/
βββ tests_trees/
βββ tests_graphs/
Each folder has its corresponding test suite under the
/testsdirectory, organized by category.
| Category | Structures |
|---|---|
| Lists | Singly Linked List, Doubly Linked List |
| Stacks & Queues | Stack (LIFO), Queue (FIFO), Deque |
| Trees | Binary Tree, Binary Search Tree |
| Graphs | Directed Graph, Flow Network |
All data structures include basic unit tests under the /tests directory.
To run all tests:
python -m unittest discover testsMake sure you're in the project root before running this command.
This project is under active development. Planned additions include:
β AVL Trees / Red-Black Trees
β Heaps (Min/Max)
β Tries
β Disjoint Sets
β Graph algorithms (BFS, DFS, Dijkstra, Prim, Kruskal)