Implementation of Algorithms in Python and C++