✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
What is the Big-O notation that can best describe the following algorithm?
procedure Alg2(x, A): A is a list of n integers
1 i = 0
2 while (i < n)
3 if (x == A[i])
4 break
5 end of if
6 i = i + 1
7 end of while
8 if (i < n)
9 location = i
a else
b location = -1
c end of if
d return location
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!