in Algorithms recategorized by
145 views
0 votes
0 votes

Worst Case scenario in case of linear search algorithm is_______________.

  1. Item is somewhere in the middle of the array
  2. Item is not in the array at all
  3. Item is the last element in the array 
  4. Item is the last element in the array or is not there at all 
in Algorithms recategorized by
145 views

1 Answer

2 votes
2 votes
Answer: D

In both the cases n comparison required(n is number of elements in array) which is the worst case. And time complexity O(n).