RCR 162: Binary search
submitted by ch00k on 2003-10-27 09:49:57
This is a legacy RCR. If this is your RCR, please resubmit it using the new format and process.
I propose to add binary search functionality to Enumerable. Add some method can be called for sorted collection (afer sort!) or, maybe it is better to introduce "is-sorted" method or flag
binary_search_first, binary_search_last - to find the first and the last occurence of object with given property
binary_search_all - to return Array of found objects (or iterate a block over them?)
Back to RCRchive.
RCR Submission page and RCRchive powered by Ruby, Apache, RuWiki (modified), and RubLog