## Invitation to Computer Science 8th Edition

Both discovered expressions are the same: $\left[\frac{n+1}{2}\right]$. This means that it can be used to calculate the average number of comparisons.
The expressions that we discovered in parts (a) and (b) are one and the same. Since we have analyzed both possibilities for $n,$ even and odd, we can say that our expression is the one we can use to calculate the average number of comparisons using sequential search in an n-element list. $\frac{n+1}{2}$