pyalgorithms

Algorithms in Python


License
BSD-3-Clause
Install
pip install pyalgorithms==0.1

Documentation

###Python Algorithms

Al-Khwarizmi

Complexity Name Examples
Θ(1) Constant Hash table lookup and modification(dict).
Θ(lg n) Logarithmic Binary search.
Θ(n) Linear Iterating over a list.
Θ(nlg n) Loglinear Optimal sorting of arbitrary values.
Θ(n**2) Quadratic Comparing n objects to each other.
Θ(n**3) Cubic Floyd and Warshall’s algorithms.
O(n**k) Polynomial k nested for loops over n.
Ω(k**n) Exponential Producing every subset of n items.
Θ(n!) Factorial Producing every ordering of n values.