PA of Algorithms Q126

0. The average number of key comparisons done on a successful sequential search in list of length n is

  • Option : D
  • Explanation :
    Suppose we want to search y.
    No of comparision
    = 1× Probability of 1st element being x
    + 2 * Probability of 2nd element being x.
    + 3* Probability of 3rd element being x.
    + n* Probability of nth element being x.
Cancel reply

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


Cancel reply

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