Github url


by keon

keon /algorithms

Minimal examples of data structures and algorithms in Python

17.6K Stars 3.6K Forks Last release: Not found MIT License 869 Commits 0 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

PyPI versionOpen Source HelpersBuild StatusCoverage Status

Pythonic Data Structures and Algorithms

Minimal and clean example implementations of data structures and algorithms in Python 3.


Thanks for your interest in contributing! There are many ways to contribute to this project. Get started here


Use unittest

For running all tests write down:

$ python3 -m unittest discover tests

For running some specific tests you can do this as following (Ex: sort):

$ python3 -m unittest tests.test\_sort

Use pytest

For running all tests write down:

$ python3 -m pytest tests


If you want to use the API algorithms in your code, it is as simple as:

$ pip3 install algorithms

You can test by creating a python file: (Ex: use





from algorithms.sort import merge\_sort if \_\_name\_\_ == "\_\_main\_\_": my\_list = [1, 8, 3, 5, 6] my\_list = merge\_sort(my\_list) print(my\_list)


If you want to uninstall algorithms, it is as simple as:

$ pip3 uninstall -y algorithms

List of Implementations


Thanks to all the contributorswho helped in building the repo.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.