111k views
4 votes
You are searching for an item in an array of 40,000 unsorted items. The item is located at the last position. How many comparisons do you need to do to find it

1 Answer

6 votes
It depends on what algorithm you’re using.
If you’re going item by item, you’ll be looking at O(n) or O(40000)
Give me a reply if you want to know more, such as if you did binary search what the Big O notation is
User Egoskeptical
by
3.7k points