kanwei / algorithms

Ruby algorithms and data structures. C extensions
http://kanwei.github.io/algorithms/
MIT License
2.67k stars 352 forks source link

add binary_search_index #20

Closed tamird closed 6 years ago

tamird commented 11 years ago

In response to #15, should address the contention therein. Also a bit of a rewrite so that the code is a bit more idiomatic.

Closes #15.

Review on Reviewable

tamird commented 11 years ago

I've changed this to not return nil if nil is being searched for. This is the same behaviour as built-in sorting methods in ruby.

tamird commented 9 years ago

@kanwei could you give this a glance?

charusat09 commented 8 years ago

It's seem all good. This needs to merge in master asap since binary search should return index of given item / element of array.

tamird commented 8 years ago

Rebased.