@bemoje/arr-sorted-indexes-of
Find all indexes at which an array element exists, by binary search.
Find all indexes at which an array element exists, by binary search.
Find the array index of where to add an element to keep it sorted.
Remove all duplicate elements in a sorted array, leaving only uniques.
Swap array elements in place. Runtime: O(1)
Check whether a condition is true for any element of an array. The condition check is in the form of a callback.
Returns true if the predicate is satisfied for every element of the passed array; otherwise false.
Return the last element of an array where the callback returns true.
Linear-time Partitioning. Runtime: O(n). Chooses a pivot and re-arrages the array so that everything on the left is <= pivot and everything on the right is > pivot
Sort an array considerably faster than the native Array.prototype.sort as a drop-in replacement. Fork of of the famous timsort module, but this module allows for passing comparator-builder options instead of a comparator function. In short, advanced compa
Create array comparator function.
For a sorted array, add an element. Whichever comparator function was used to sort the array, can be passed. Also supports comparator-builder options. For reference, see: https://github.com/bemoje/bemoje-arr-sort-comparator
Binary search -based indexOf for sorted arrays.
Binary search -based indexOf for sorted arrays.
Iterate an array in reverse.
Return the index of the first element of an array where the callback returns true. Returns -1 if none do.
Sorting by insertion - Look for bigger numbers on the left side. Runtime: O(n^2). It starts from the 2nd element, and it tries to find any element (to the left) that could be bigger than the current index. It will move all the elements that are bigger and
📇 An index of routes exposed by Express app
Jaccard Index Javascript Library
Checks if value is found in array
A spatial indexed (qix) Shapefile reader