import { Comparator } from '../../typings/function-types'; export declare namespace Sorting { /** * @private * @module sorting * @param data Input {Array}. * @param index1 index {Integer}. * @param index2 index {Integer} to swap_ with. */ const swap: (data: T[], index1: number, index2: number) => void; /** * @public * @module sorting * @param {Array} array Input array. * @param {Function} cmp Optional. A function that defines an * alternative sort order. The function should return a negative, * zero, or positive value, depending on the arguments. * @return {Array} Sorted Array * * best time: O(n) * average time: O(n * n) * worst time: O(n * n) * memory: in-place * stable: true */ const bubbleSort: (array: T[], cmp?: import("../../typings/function-types").BiProcessor | undefined) => T[]; /** * @public * @module sorting * @param {Array} array Input array. * @param {Function} cmp Optional. A function that defines an * alternative sort order. The function should return a negative, * zero, or positive value, depending on the arguments. * @return {Array} Current sorted array. * */ const bucketSort: (array: number[], cmp: Comparator) => number[]; /** * @public * @module sorting * @param {Array} array Input array. * @param {Function} cmp Optional. A function that defines an * alternative sort order. The function should return a negative, * zero, or positive value, depending on the arguments. * @return {Array} Current sorted array. * * @example * var sort = require('path-to-algorithms/src/sorting/shellsort').shellSort; * console.log(sort([2, 5, 1, 0, 4])); // [ 0, 1, 2, 4, 5 ] * */ const shellSort: (array: T[], cmp?: import("../../typings/function-types").BiProcessor | undefined) => T[]; /** * @public * @module sorting * @param {Array} array Input array. * @param {Integer} step Sorting step. * @param {Function} cmp Optional. A function that defines an * alternative sort order. The function should return a negative, * zero, or positive value, depending on the arguments. * @return {Array} Current sorted array. * * @example * var initArray = [0, 100, 5, 1, 3, 4, 213, 4, 2, 4, 4]; * var initArraySorted = shellSort(initArray, initArray.length); * document.writeln("shellSort: " + initArraySorted); * */ const shellSort2: (array: T[], step: number, cmp?: import("../../typings/function-types").BiProcessor | undefined) => T[]; /** * @public * @module sorting * @param {Array} array Input array. * @param {Function} cmp Optional. A function that defines an * alternative sort order. The function should return a negative, * zero, or positive value, depending on the arguments. * @return {Array} Current sorted array. * * @example * var res = globals.algorithms.shellsort([3, 4, 4, 5, 6, 6]); * document.writeln('shellsort: ' + res); * */ const shellsort3: (array: T[], cmp?: import("../../typings/function-types").BiProcessor | undefined) => T[]; /** * @public * @module sorting * @param {Array} array Input array. * @param {Integer} left Left border. * @param {Integer} right Right border. * @param {Function} cmp Optional. A function that defines an * alternative sort order. The function should return a negative, * zero, or positive value, depending on the arguments. * @return {Array} Current sorted array. * * @example * var initArray = [0, 100, 5, 1, 3, 4, 213, 4, 2, 4, 4]; * var initArraySorted = globals.algorithms.hooraSort(initArray, 0, 10); * document.writeln("hooraSort: " + initArraySorted); * */ const hooraSort: (array: T[], left: number, right: number, cmp?: import("../../typings/function-types").BiProcessor | undefined) => T[]; /** * @public * @module sorting * @param {Array} array Input array. * @param {Function} cmp Optional. A function that defines an * alternative sort order. The function should return a negative, * zero, or positive value, depending on the arguments. * @return {Array} Current sorted array. * * @example * var res = globals.algorithms.insertionSort([3, 4, 4, 5, 6, 6]); * document.writeln('insertsort: ' + res); * * best time: O(n) * average time: O(n*n) * worst time: O(n*n) * memory: local * stable: true * */ const insertionSort2: (array: T[], cmp?: import("../../typings/function-types").BiProcessor | undefined) => T[]; /** * @public * @module sorting * @param {Array} array Input array. * @param {Function} cmp Optional. A function that defines an * alternative sort order. The function should return a negative, * zero, or positive value, depending on the arguments. * * best time: O(n) * average time: O(n*n) * worst time: O(n*n) * memory: in-place * stable: false */ const selectionSort: (array: T[], start: number, cmp?: import("../../typings/function-types").BiProcessor | undefined) => void; /** * @public * @module sorting * @param {Array} array Input array. * @param {Function} cmp Optional. A function that defines an * alternative sort order. The function should return a negative, * zero, or positive value, depending on the arguments. * @return {Array} Current sorted array. * * best time: O(nlog(n)) * average time: O(nlog(n)) * worst time: O(nlog(n)) * memory: O(n) * stable: false */ const mergeSort: (array: T[], cmp?: import("../../typings/function-types").BiProcessor | undefined) => T[]; const mergeSort2: (array: T[], cmp?: import("../../typings/function-types").BiProcessor | undefined) => void; /** * @public * @module sorting * @param {Array} array Input array. * @param {Function} cmp Optional. A function that defines an * alternative sort order. The function should return a negative, * zero, or positive value, depending on the arguments. * * best time: O(nlog(n)) * average time: O(nlog(n)) * worst time: O(n * n) * memory: in-place * stable: false */ const quicksortOptimized: (array: T[], cmp?: import("../../typings/function-types").BiProcessor | undefined) => void; /** * @public * @module sorting * @param {Array} array Input array. * @param {Function} cmp Optional. A function that defines an * alternative sort order. The function should return a negative, * zero, or positive value, depending on the arguments. * @return {Array} Current sorted array * * @example * var initArray = [0, 100, 5, 1, 3, 4, 213, 4, 2, 4, 4]; * var initArraySorted = globals.algorithms.quickSort(initArray); * document.writeln("quickSort: " + initArraySorted); * * best time: O(nlog(n)) * average time: O(nlog(n)) * worst time: O(n * n) * memory: in-place * stable: false */ const quickSort: (array: T[], cmp?: import("../../typings/function-types").BiProcessor | undefined) => T[]; /** * @public * @module sorting * @param {Array} array Input array. * @param {Integer} min start index. * @param {Integer} max end index. * @param {Function} cmp Optional. A function that defines an * alternative sort order. The function should return a negative, * zero, or positive value, depending on the arguments. * @return {Array} Sorted array * * @example * var res = globals.algorithms.heapsort([3, 4, 5, 2, 1, 4, 4, 2, 5, 1, 6, 2, 4]); * document.writeln('heapSort: ' + res); */ /** * @public * @module sorting * @param {Array} array Input array. * @param {Function} cmp Optional. A function that defines an * alternative sort order. The function should return a negative, * zero, or positive value, depending on the arguments. * @return {Array} Current sorted array * * @example * var res = globals.algorithms.heapsort([3, 4, 5, 2, 1, 4, 4, 2, 5, 1, 6, 2, 4]); * document.writeln('heapSort: ' + res); */ const heapsort2: (array: T[], cmp?: import("../../typings/function-types").BiProcessor | undefined) => T[]; /** * @public * @module sorting * @param {Array} array Input array. * @param {Function} cmp Optional. A function that defines an * alternative sort order. The function should return a negative, * zero, or positive value, depending on the arguments. * @return {Array} Current sorted array * * @example * var res = globals.algorithms.heapsort([3, 4, 5, 2, 1, 4, 4, 2, 5, 1, 6, 2, 4]); * document.writeln('heapSort: ' + res); */ const heapsort3: (array: T[], cmp?: import("../../typings/function-types").BiProcessor | undefined) => T[]; /** * @public * @module sorting * @param {Array} array Input array. * @param {Function} cmp Optional. A function that defines an * alternative sort order. The function should return a negative, * zero, or positive value, depending on the arguments. * @return {Array} Current sorted array */ /** * @public * @module sorting * @param {Array} array Input array. * @param {Function} cmp Optional. A function that defines an * alternative sort order. The function should return a negative, * zero, or positive value, depending on the arguments. */ const insertionSort: (array: T[], cmp?: import("../../typings/function-types").BiProcessor | undefined) => void; /** * @public * @module sorting * @param {Array} array Input array. * @param {Integer} min start index. * @param {Integer} max end index. * @param {Function} cmp Optional. A function that defines an * alternative sort order. The function should return a negative, * zero, or positive value, depending on the arguments. */ const sort: (array: T[], min: number, max: number, cmp?: import("../../typings/function-types").BiProcessor | undefined) => void; /** * @public * @module sorting * @param {Array} array Input array. * @param {Function} cmp Optional. A function that defines an * alternative sort order. The function should return a negative, * zero, or positive value, depending on the arguments. */ const gnomeSort: (array: T[], cmp?: import("../../typings/function-types").BiProcessor | undefined) => void; /** * @public * @module sorting * @param {Array} array Input array. * @param {Function} cmp Optional. A function that defines an * alternative sort order. The function should return a negative, * zero, or positive value, depending on the arguments. */ const cocktailSort: (array: T[], cmp?: import("../../typings/function-types").BiProcessor | undefined) => void; /** * @public * @module sorting * @param {Array} array Input array. * @param {Function} cmp Optional. A function that defines an * alternative sort order. The function should return a negative, * zero, or positive value, depending on the arguments. * @return {Array} Sorted Array */ const simpleCountSort: (array: T[], cmp?: import("../../typings/function-types").BiProcessor | undefined) => T[]; /** * @public * @module sorting * @param {Array} array Input array. * @param {Function} cmp Optional. A function that defines an * alternative sort order. The function should return a negative, * zero, or positive value, depending on the arguments. * @return {Array} Sorted Array */ const combSort: (array: T[], cmp?: import("../../typings/function-types").BiProcessor | undefined) => void; } //# sourceMappingURL=sorting.d.ts.map