@picosearch/trie
Version:
Simple, zero dependency, type-safe implementation of a trie data structure.
11 lines (10 loc) • 363 B
TypeScript
/**
* Insert a value into a sorted array efficiently.
*
* Reference: https://stackoverflow.com/a/21822316
*
* @param array - The array to insert into. Must be sorted.
* @param value - The value to insert.
* @param compare - The comparison function.
*/
export declare const sortedInsert: <T>(array: T[], value: T, compare: (a: T, b: T) => number) => void;