1.

What is the formula to find the expected number of probes for an unsuccessful search in linear probing?(a) \(\frac{1}{2} \frac{1+1}{(1-⅄)}\)(b) \(\frac{1}{2}\frac{1+1}{(1-⅄)^2}\)(c) \(\frac{1}{2}\frac{1+1}{(1+⅄)}\)(d) \(\frac{1}{2}\frac{1+1}{(1+⅄)(1-⅄)}\)My question is based upon Hash Tables in section Hash Tables of Data Structures & Algorithms II got this question during an online interview.

Answer»

The CORRECT option is (b) \(\frac{1}{2}\frac{1+1}{(1-⅄)^2}\)

The BEST I can explain: The mathematical FORMULA for calculating the number of probes for an UNSUCCESSFUL search is \(\frac{1}{2}\frac{1+1}{(1-⅄)^2}\). For INSERTION, it is \(\frac{1}{2} \frac{1+1}{(1-⅄)}\).



Discussion

No Comment Found

Related InterviewSolutions