Algorithms in Python along with Time complexity picture