News for hackers. Stuff that matters.
Re:Beautiful branchless binary search by account42 on Friday April 28, 2023 @06:28AM (#35739531)
It's still misleading to call this a binary search when that is commonly understood as an algorithm operating on a sorted range which is not just an arbitrary datastructure but something that already exists in many situations. If you just need fast lower_bound lookup for a set that you control and which has no other uses then sure this is nice, but more commonly you only care if an element is in the set and in that case if you can control the data structure then there are many more options.
Re:Beautiful branchless binary search by eska on Friday April 28, 2023 @07:19AM (#35739888)
I agree with you.

Algorithms don’t exist in a bubble, but are always accompanied with a data structure.

A heap sorted array is different from a linearly sorted array. Binary search is only defined for the latter.