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.
the iterable
the number of items to get
the comparator
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.