Closed hickford closed 9 years ago
I have a C5.TreeSet<double>
C5.TreeSet<double>
Given a value x, I'd like to search the set S for the greatest index i such S[j] <= x for all j ≤ i (similar to Python's bisect.bisect). How can I do that?
x
S
i
S[j] <= x
bisect.bisect
I was previously using List<T> with BinarySearch
List<T>
BinarySearch
Reproduced from http://stackoverflow.com/questions/30624322/how-to-search-c5-treeset
When S is a TreeSet, or more generally, an IIndexedSorted, then S.CountTo(x) will give you the number of items strictly less than x.
I have a
C5.TreeSet<double>
Given a value
x
, I'd like to search the setS
for the greatest indexi
suchS[j] <= x
for all j ≤ i (similar to Python'sbisect.bisect
). How can I do that?I was previously using
List<T>
withBinarySearch
Reproduced from http://stackoverflow.com/questions/30624322/how-to-search-c5-treeset