English

If the key to be searched is the last element in the list, then linear search algorithm will make how many comparisons?

Advertisements
Advertisements

Question

If the key to be searched is the last element in the list, then linear search algorithm will make how many comparisons?

Options

  • n(n + 1)/2

  • n - 1

  • n

  • n + 1

MCQ
Advertisements

Solution

n

shaalaa.com
Linear Search in Python
  Is there an error in this question or solution?
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×