Algorithm and Time Complexity