The time complexity of the algorithm is: