Some classic algorithms implemented in Python 2.7