# Answer to Question #73686 in Algorithms for L Anderson Jr

Question #73686

Consider an array of prime integers in the range [1...20] with the entries randomly distributed. Find the average number of comparisons for a sequential search in the array.

Expert's answer

Answer on Question #73686 - Algorithms

Prime integers in the range [1...20] are 2, 3, 5, 7, 11, 13, 17, 19 (8 numbers).

The sequential search in a randomly distributed array for any present element will

give such number of comparisons for each particular place:

0, 1, …, 7.

All positions have equal possibility, so let’s take the average:

So, the average number of comparisons for a sequential search in the array is 4.5.

Prime integers in the range [1...20] are 2, 3, 5, 7, 11, 13, 17, 19 (8 numbers).

The sequential search in a randomly distributed array for any present element will

give such number of comparisons for each particular place:

0, 1, …, 7.

All positions have equal possibility, so let’s take the average:

So, the average number of comparisons for a sequential search in the array is 4.5.

Need a fast expert's response?

Submit orderand get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

## Comments

## Leave a comment