The Wayback Machine - https://web.archive.org/web/20190322165810/https://github.com/keon/algorithms
Skip to content
Please note that GitHub no longer supports Internet Explorer.

We recommend upgrading to the latest Microsoft Edge, Google Chrome, or Firefox.

Learn more
Minimal examples of data structures and algorithms in Python
Branch: master
Clone or download
JKLiang9714 and keon fix bugs, add descriptions, and add tests (#486)
* fix: test_heap, tree/traversal/__init__

* fix a error in longest_non_repeat.py

* fix bugs, add notes, and add tests
Latest commit f438cd3 Mar 8, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
algorithms fix bugs, add descriptions, and add tests (#486) Mar 8, 2019
docs update logo path (#382) Jul 27, 2018
tests fix bugs, add descriptions, and add tests (#486) Mar 8, 2019
.coveragerc
.gitignore
.travis.yml
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT_FR.md
CONTRIBUTING.md edited Contributing.md to add 'doc_xxx' (#392) Aug 15, 2018
CONTRIBUTING_ES.md
CONTRIBUTING_FR.md Doc fr (#394) Aug 19, 2018
CONTRIBUTING_JP.md Created README and CONTRIBUTING files in Japanese (#289) May 30, 2018
CONTRIBUTING_KR.md Created CONTRIBUTING_KR.md in Korean (#290) Jun 5, 2018
LICENSE Create LICENSE May 31, 2017
MANIFEST.in remove `tests/*` from MANIFEST.in (#354) Jun 12, 2018
PULL_REQUEST_TEMPLATE.md Created PULL_REQUEST_TEMPLATE.md (#311) Jun 6, 2018
README.md add atbash, crout, hosoya triangle algorithms (#470) Jan 24, 2019
README_CN.md
README_ES.md
README_FR.md
README_GE.md add atbash, crout, hosoya triangle algorithms (#470) Jan 24, 2019
README_JP.md add atbash, crout, hosoya triangle algorithms (#470) Jan 24, 2019
README_KR.md
README_PTBR.md add atbash, crout, hosoya triangle algorithms (#470) Jan 24, 2019
requirements.txt
setup.py
test_requirements.txt
tox.ini WIP: Fix some issues in Travis and add more python env (#323) Jun 7, 2018
tree.md Update tree.md (#332) Jun 7, 2018

README.md

English | 简体中文 | Deutsch | 日本語 | 한국어 | Português | Français | Español

PyPI version 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 algorithms

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

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)

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.

You can’t perform that action at this time.