JOIN
Get Time
forums   
Search | Watch Thread  |  My Post History  |  My Watches  |  User Settings
View: Flat (newest first)  | Threaded  | Tree
Previous Thread  |  Next Thread
Little correction needed | Reply
Excellent article, and heartfelt thanks for introducing me predicate based algorithm design.

I found some correction needed in the following para,

"The logarithm is an awfully slowly growing function. In case you're not aware of just how efficient binary search is, consider looking up a name in a phone book containing a million names. Binary search lets you systematically find any given name using at most 21 comparisons."

Referring to the implementation in the article, every iteration except the last does two comparisons. Hence we need (2*21 - 1) = 41 comparisons to search a name among one million names.
RSS