Implementations of various algorithms in python