Python Implementation of various Algorithms