Some simple algorithms implemented in Python