Question
We have said that the average number of comparisons need to find a target value in an n-element list using sequential search is slightly higher
We have said that the average number of comparisons need to find a target value in an n-element list using sequential search is slightly higher than n/2. In this problem, we find an exact expression for this average.
a. Supose the ist has an odd number of items. say 15. At what position is the middle item? Using sequential search, how many comparisons are required to find the middle item? Repeat this exeecise with a few more odd numbers until you can do the following: If there are n items in the list and n is an odd number, write an expression for the number of comparisons required to find the middle term.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started