5 ms·
IMO binary search is not a fancy algorithm. Modern sort functions are fancy, and can have subtle bugs, which is why ordinary devs should not write their own. Ev
by kagakuninja 3y ago
IMO binary search is not a fancy algorithm. Modern sort functions are fancy, and can have subtle bugs, which is why ordinary devs should not write their own. Even quicksort has foot guns.
Rob Pike's response would probably be to profile the code first, then see if your fancy code or alternate data structure makes it faster.