I am trying to do sorting lazily. In the pseudo-code below which sorts ascending,
take 2 sort([5 8 1 3 4])
I want to sort only till I get the first two sort values. I could not find any build-in enumeration on sort operation.
What's the sort algorithm used by NSArray implementation? How to sort lazily in Objective-C?