This repository contains implementations of common algorithms and data structures, accompanied by corresponding test cases. The main objective of this repository is to facilitate learning, rather than providing optimized code for production environments. Contributions from the community are welcome.
Currently, all the code is written in Python 3.10
.
The project is structure as follows:
- Each algorithm or data structure category has its own Python script. For example, sorting algorithms are implemented in
sorting.py
. - For each algorithm or data structure implementation, there is a corresponding script for unit tests.
In the future I would like to make this project a package that could be used to visualize the behaviour of the different algorithms and data structures.
Algorithm | Description | Implementation | Tests |
---|---|---|---|
Bubble sort | link | sorting.py | test_sorting.py |
Insertion sort | link | sorting.py | test_sorting.py |
Selection sort | link | sorting.py | test_sorting.py |
Merge sort | link | sorting.py | test_sorting.py |
Quick sort | link | sorting.py | test_sorting.py |
Quick sort in-place | link | sorting.py | test_sorting.py |
Linear search | link | searching.py | test_searching.py |
Binary search | link | searching.py | test_searching.py |
Data Structure | Description | Implementation | Tests |
---|---|---|---|
Linked List | link | linked_list.py | test_linked_list.py |
Stack | link | stack.py | test_stack.py |
Queue | link | queue_.py | test_queue.py |
Binary Search Tree | link | bst.py | test_bst.py |
Red Black Tree | link | red_black_tree.py | test_red_black_tree.py |