Implementations of classic algorithms