93.4k views
4 votes
What is the worst case running time of a linear search?

O(1)

O(log10N)

O(log2N)

O(log2N)

O(N)

O(N log N)

O(N2)

O(N3)

O(Nk)

O(2N)

O(N!)

User Dvvrd
by
5.1k points

2 Answers

4 votes

Answer:

o(n)

Step-by-step explanation:

User Ahmad Vatani
by
5.6k points
6 votes

Answer:

The worst case running time of a linear search is O(N).

Step-by-step explanation:

In a linear search, you will run the program looking at each array position until you find your desired information.

The best case scenario is when you find it at the first position.

The worst case scenario is when you find the value at the last array position. So, in a N-length array, the information is at position N. This means that the worst case running time of a linear search is O(N).

User The Zero
by
4.7k points