Usage examples of binary search
Posted
by
python dude
on Stack Overflow
See other posts from Stack Overflow
or by python dude
Published on 2011-02-10T07:14:30Z
Indexed on
2011/02/10
7:25 UTC
Read the original article
Hit count: 140
I just realized that in my 4+ years of Java programming (mostly desktop apps) I never used the binary search methods in the Arrays class for anything practical. Not even once. Some reasons I can think of:
- 100% of the time you can get away with linear search, maps or something else that isn't binary search.
- The incoming data is almost never sorted, and making it sorted requires an extra sorting step.
So I wonder if it's just me, or do a lot of people never use binary search? And what are some good, practical usage examples of binary search?
© Stack Overflow or respective owner