systemsfault systemsfault - 6 months ago 101
Java Question

Java's equivalent to bisect in python

Is there a java's equivalent to python's bisect library? With python's bisect you can do array bisection with directions. For instance bisect.bisect_left does:

Locate the proper insertion point for item in list to maintain sorted order. The parameters lo and hi may be used to specify a subset of the list which should be considered; by default the entire list is used.

Note: Sure of course i now i can do this manually with a binary search too, but wondered if there is already a lib or collection doing this.


You have two options: