안하면 다시 헷갈리는 Big O 계산
How to calculate
Worst case
always care about the worst(not the best) case.
Remove Constants
while 문은 n의 절반만 체크함 (middleIndex)
for loop 은 100까지만 돈다! (i<100)
O(1+n/2+100 )
=> O(n) drop the constant 1,2,100
Different terms for inputs
Drop Non Dominants
Case1
O(3+4n) => O(n)
Case 2
O(4+5n) => O(n)