Common algorithms written in Python