Minimal examples of data structures and algorithms in Python
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 130 commits behind keon:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
arrays
backtrack
bfs
bit
calculator
dfs
dp
graph
heap
linkedlist
map
maths
matrix
queues
search
set
sort
stack
strings Add fizzbuzz.py in strings folder Apr 27, 2018
tests
tree
union-find
.coveragerc
.gitignore
.travis.yml
CODE_OF_CONDUCT.md
CONTRIBUTING.md
LICENSE
README.md
README_CN.md
README_GE.md
requirements.txt
setup.py
tree.md

README.md

English | 简体中文 | Deutsch

Open Source Helpers Build Status Coverage Status

Pythonic Data Structures and Algorithms

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

Contributing

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

Tests

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

Install

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

$ pip3 install git+https://github.com/keon/algorithms

You can test by creating a python file: (Ex: use merge_sort in sort)

from sort import merge_sort

if __name__ == "__main__":
    my_list = [1, 8, 3, 5, 6]
    my_list = merge_sort.merge_sort(my_list)
    print(my_list)

Uninstall

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

$ pip3 uninstall -y algorithms

List of Implementations

Contributors

The repo is maintained by

And thanks to all the contributors who helped in building the repo.