Discrete Mathematics and Its Applications, Seventh Edition

Published by McGraw-Hill Education
ISBN 10: 0073383090
ISBN 13: 978-0-07338-309-5

Chapter 7 - Section 7.4 - Expected Value and Variance - Exercises - Page 492: 9

Answer

$\frac{4n+6}{6}$

Work Step by Step

We have to find the average-case computational complexity of the linear search algorithm if the probability that $x$ is in the list is $p$ and it is equally likely that $x$ is any of the $n$ elements in the list. $E=p(n+2)+ (2n+2)(1-p)$ Substituting $p=\frac{2}{3}$, we have $E=\frac{2(n+2)}{3}+\frac{(2n+2)}{3}=\frac{4n+6}{3}$
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.