iter-fns - v0.13.0
    Preparing search index...

    Function largest

    • Gets the largest items of the iterable in descending order.

      This uses a min-heap algorithm and runs in O(|iterable| log k) time.

      Note that even if k = 0, it will still iterate through the entire iterable.

      Type Parameters

      • T

      Parameters

      • iterable: Iterable<T>

        the iterable

      • k: number

        the number of items to get

      • cmp: Compare<T> = compare

        the comparator

      Returns T[]