I know that the function is executed ln(N)/ln(K) times;but in average does it make K operations?
Questions:
- is there any proof that k*ln(N)/ln(K) is the average number of executions?
- If this formula is correct, then ternary search will be the fastest search as k/ln(k) will be minimum (for integers) because 3 is the closest integer to "e" (the real minimum) which is very easy to prove using differentiation.
Furthermore I believe that ternary search is faster;because I made a comparing computer program.