Very fast insertion into a sorted array of numbers, often 2 orders of magnitude faster than conventional methods.
While conventional sorted array insertion is O(n log n), fast-sorted-array
insertion time is O(log n).
npm install fast-sorted-array
const {sortedFind, sortedInsert} = require('fast-sort-array');
const array = [/* ... */];
const number = 3.14;
let index = sortedFind(number, array);
let position = sortedInsert(number, array);