Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A Python module for learning all major algorithms

License

NotificationsYou must be signed in to change notification settings

OmkarPathak/pygorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PackagistDownloadsDocumentation StatusPython 3.6Say 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 understandDocumentation
  • 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 usepip install --user pygorithm to install.
  • Or you can download the source code fromhere, and then just install the package using
python setup.py install

Quick Start Guide

  • To sort your list
>>>frompygorithm.sortingimportbubble_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
>>>frompygorithm.sortingimportbubble_sort>>>code=bubble_sort.get_code()>>>print(code)
  • To get the time complexity of an algorithm
>>>frompygorithm.sortingimportbubble_sort>>>time_complexity=bubble_sort.time_complexities()>>>print(time_complexity)
  • To see all the available functions in a module, you can just typehelp() with the module name as argument. For example,
>>>frompygorithmimportsorting>>>help(sorting)Helponpackagepygorithm.sortinginpygorithm:NAMEpygorithm.sorting-CollectionofsortingmethodsPACKAGECONTENTSbubble_sortbucket_sortcounting_sortheap_sortinsertion_sortmerge_sortmodulesquick_sortselection_sortshell_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 thetests/ 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 :)


[8]ページ先頭

©2009-2025 Movatter.jp