Function heappop

  • Pop and return the smallest item from the heap, maintaining the heap invariant.

    Type Parameters

    • T


    • heap: T[]
    • Optional compareFn: ((x: any, y: any) => number) = compare

      Custom compare function

        • (x: any, y: any): number
        • Checks whether x is a comparable type and returns the result of Otherwise the return value of the compare function is equivalent to obj === other ? 0 : obj < other ? -1 : 1


          The comparison result



          • x: any

            An initial value

          • y: any

            Other value to compare

          Returns number

    Returns T

Generated using TypeDoc