Determine for a fixed n, the values of p

As shown in Section 2.1, the average number of key comparisons made by sequential search (without a sentinel, under standard assumptions about its inputs) is given by the formulaCavg(n)=p(n + 1) 2+ n(1-p),where p is the probability of a successful search. Determine, for a ?xed n, the values ofp (0=p =1) for which this formula yields the largest value of Cavg(n) and the smallest value of Cavg(n).

Leave a Reply

Your email address will not be published. Required fields are marked *