Gets the smallest items of the iterable in ascending order.
This uses a min-heap algorithm and runs in O(|iterable| log k) time.
Note that even if n = 0, it will still iterate through the entire iterable.
the iterable
the number of items to get
the comparator
Gets the smallest items of the iterable in ascending order.
This uses a min-heap algorithm and runs in O(|iterable| log k) time.
Note that even if n = 0, it will still iterate through the entire iterable.