Implementation of a few classic Algorithims