Various algorithms implemented in Python