i have a question about O-notation. (big O)
In my code, i am using a for loop to iterate through an array of users. The for loop has if-statements that makes it break out of the loop, if the rigth user is found.
My question is how i measure the O-notation?
Is the O-notation is O(N) as i loop through all the users in the array? Or is the O-notation O(1), as the loop breaks and never runs again?