completed runningTime of Algorithms. Problem in printing stuff