Iterative Algorithm Time Complexity