UNPKG

sorting-algorithms-lib

Version:

sorting-algorithms-lib is a lightweight JavaScript library that provides efficient implementations of various sorting algorithms. Whether you're learning algorithms, benchmarking performance, or building a project that requires sorting, this library has y

8 lines (7 loc) 336 B
/** * Given an array, swaps two elements at the specified positions (indices). * @param array Array in which to swap elements between two positions * @param pos1 Index of first element's position * @param pos2 Index of second element's position */ export declare function swap(array: Array<any>, pos1: number, pos2: number): void;