7 Star 7 Fork 0

Gitee 极速下载 / pygorithm

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/OmkarPathak/pygorithm
Clone or Download
contribute
Sync branch
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README
MIT

Pygorithm

Packagist Downloads Documentation Status Python 3.6 Say Thanks! Contributors
A Python module to learn all the major algorithms on the go!
Purely for educational purposes
https://images.gitads.io/pygorithm

Features

  • Super easy to use
  • A very easy to understand Documentation
  • Get the code right in your editor
  • Get time complexities on the go

Installation

  • Just fire the following command in your terminal:
pip3 install pygorithm
  • It's that easy. If you are using Python 2.7 use pip instead. Depending on your
    permissions, you might need to use pip install --user pygorithm to install.
  • Or you can download the source code from here, and then just install the package using
python setup.py install

Quick Start Guide

  • To sort your list
>>> from pygorithm.sorting import bubble_sort
>>> my_list = [12, 4, 3, 5, 13, 1, 17, 19, 15]
>>> sorted_list = bubble_sort.sort(my_list)
>>> print(sorted_list)
>>> [1, 3, 4, 5, 12, 13, 15, 17, 19]
  • To get the code for function used
>>> from pygorithm.sorting import bubble_sort
>>> code = bubble_sort.get_code()
>>> print(code)
  • To get the time complexity of an algorithm
>>> from pygorithm.sorting import bubble_sort
>>> time_complexity = bubble_sort.time_complexities()
>>> print(time_complexity)
  • To see all the available functions in a module, you can just type help() with the module name as argument. For example,
>>> from pygorithm import sorting
>>> help(sorting)
    Help on package pygorithm.sorting in pygorithm:

    NAME
        pygorithm.sorting - Collection of sorting methods

    PACKAGE CONTENTS
        bubble_sort
        bucket_sort
        counting_sort
        heap_sort
        insertion_sort
        merge_sort
        modules
        quick_sort
        selection_sort
        shell_sort

Tests

  • Just type in the following command to run the tests
python3 -m unittest
  • This will run all the tests defined in the files of the tests/ directory

Donation

If you have found my softwares to be of any use to you, do consider helping me pay my internet bills. This would encourage me to create many such softwares :)

MIT License Copyright (c) 2017 Omkar Pathak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Pygorithm 是一个学习重要算法的 Python 模块 expand collapse
Python
MIT
Cancel

Releases

No release

Contributors

All

Activities

Load More
can not load any more
Python
1
https://gitee.com/mirrors/pygorithm.git
git@gitee.com:mirrors/pygorithm.git
mirrors
pygorithm
pygorithm
master

Search

14c37bed 8189591 565d56ea 8189591