Comment on Binary search

<- View Parent
Ephera@lemmy.ml ⁨2⁩ ⁨weeks⁩ ago

You know, after posting that comment, I really doubted myself, if it really is binary search, because Wikipedia also tells me it needs to be a sorted array.

But yeah, I think that’s only relevant, if your method of checking whether it’s in one half or the other uses > and <. As far as I can tell, so long as you can individually identify the fuses, a.k.a. they’re countable, then you can apply binary search.

source
Sort:hotnewtop