Explain average number of comparisons in a sequential search

Determine the sequential search and the average number of comparisons in a sequential search.

E

Expert

Verified

Sequential search:

When searching an element within an array, the search starts by the first element until the last element. The average number of comparisons within a sequential search is as (N+1)/2, here N is the size of the array. When the element is within the first position then the no. of comparisons will be 1 and when the element is in the final position then the number of comparisons will be N.

   Related Questions in Data Structure & Algorithms

©TutorsGlobe All rights reserved 2022-2023.