|
|
|
|
|
by senfiaj
50 days ago
|
|
The title is slightly misleading, I mean yes, naive binary search might have larger constant but the algorithm is still O(log(n)). This is still some "divide and conquer" style algorithm just with bunch of CPU specific optimizations. Also this works well with simple data structures, like integers, with more complex objects (custom comparators) it matters less. |
|
So not exactly "n" as in O(n).
Also: only for 16-bit integers.