swift-algorithms
swift-algorithms copied to clipboard
Binary search function for collection or array
In c++ there has a stl function named as lower_bound which works as binary search. But in swift there has no such function. Could you please add it?
partitioningIndex(where:)
is a slight generalization of a binary search, and is an O(log n) operation for random-access collections; O(n) otherwise.
Hey! I got how to do this and have successfully written code for the required lower bound and upper bound. Can you please help me what i have to do to create a pull request? And where I have to paste this code. (as I am new to open source)