UNPKG

hd-utils

Version:

A handy utils for modern JS developers

7 lines (6 loc) 270 B
import { StringOrNumber } from '../types'; /** * @description an implementation for heapSort algorithm, it will sort an array of numbers or strings. * @example heapSort([3,2,1]) // [1,2,3] */ export default function heapSort<T extends StringOrNumber>(arr: T[]): T[];