implementations for classic algorithms in python