In the book Programming Interviews Exposed it says that the complexity of the program below is O(N), but I don\'t understand how this is possible. Can someone expla
@Daniel Fischer's answer is correct.
I would like to add the fact that this algorithm's exact running time is as follows:
Which means: