The algorithms3x is a python package with 5 sorting/searching algorithms. The package would keep updating as python itself updates to higher versions.
It contains the following algorithms:
- Selection sort
- Bubble sort
- Linear search
- Binary search
- Merge sort
If not already install pip
Install the package with pip
or pip3
:
pip install python-algorithms-3x
from superalgo.search import linear_search
linear_search([1, 2, 3], 4)
Output:
False
from superalgo.sort import merge_sort
print(merge_sort([4, 1, 2, 3]))
Output:
[1, 2, 3, 4]