Description Usage Arguments Value Examples
this niche function compares key to val by cmpf(val, key), and returns the indices that passed cmpf(). FindIdx assumes that val and key are sorted by cmpf and finds indices in O(n). FindIdxUnsorted assumes that val and key are not sorted and finds indices in O(n^2). Since cmpf is arbitrary, binary search is not used.
1 2 3 | FindIdx(val, key, cmpf = `>=`)
FindIdxUnsorted(val, key, cmpf = `>=`)
|
val |
a vector of values. |
key |
a vector of keys to find in val. |
cmpf |
a comparison function. |
a vector of found indices.
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.