@blakek/sorted-array
🔢 more efficient array functions for sorted arrays (e.g. binary search)
🔢 more efficient array functions for sorted arrays (e.g. 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.
Sort array by bubbling up bigger values to the right side. Runtime: O(n^2)
Selection sort array
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
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.
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
check if a array is sorted
A small module to check if an Array is sorted, study from dcousens/is-sorted
A small module to check if an Array is sorted
Maintain 'n' smallest elements in order
This is a basic implementation of a sorted array, designed to maintain a collection of items in such a way that it can easily be searched via binary search. Built with effeciency and ease of use in mind.
"Keyed and Indexed Map", a pure javascript object that simulates the native 'Map' object with indexing features and others useful methods.
A sorted array which sorts lazily, written entirely in TypeScript
Javascript Object With Ordered Keys
This is a simple binary heap implementation in nodejs, without dependencies
Order object by ascending or descending