import type { CompareFunction } from "../types/array/compareFunction"; /** * Implementation of the TimSort algorithm, which combines the best features of * insertion sort and merge sort. It provides a stable sort with O(n log n) * worst-case time complexity. * * @param {T[]} array Array to sort * @param {CompareFunction} [compareFunction=compareFunctionDefault] * Function to compare elements * @param {number} [start=0] Starting index for the sort range * @param {number} [end=array.length - 1] Ending index for the sort range * @returns {T[]} Sorted array * @example * timSort([3, 1, 4, 1, 5]); // [1, 1, 3, 4, 5] * timSort(['b', 'a', 'c']); // ['a', 'b', 'c'] */ export declare const timSort: (array: T[], compareFunction?: CompareFunction, start?: number, end?: number) => T[];