https://stackoverflow.com/questions/24537366/average-complexity-of-binary-search-for-an-unsuccessful-search
Sn=(I(n)+n)/n
Un=E(n)/(n+1)
Sn=(((n+1)/n)Un-1
where Sn be the average number of comparisons required for successful search and Un be the average number of comparison required for an unsuccessful search .
I(n) is total internal path length and E(n) is total external path length .
http://cse.iitkgp.ac.in/~pb/algo-1-pb-10.pdf
see this for more clearation.
64.3k questions
77.9k answers
244k comments
80.0k users