Klitos Kyriacou
04/28/2025, 5:21 PMveryLargeList.Order().Take(10).ToList();
Does a Quickselect/partial Quicksort to avoid having to sort the entire array.
Is there any chance that Kotlin Sequences can be optimized in the same way?
veryLargeList.asSequence().sorted().take(10).toList()
Youssef Shoaib [MOD]
04/28/2025, 5:27 PMtake
can check for that and optimize it.
An alternative would be a sorted(10)
method that specifically did quickselectkevin.cianfarini
04/29/2025, 1:35 PMYoussef Shoaib [MOD]
04/29/2025, 1:45 PMkevin.cianfarini
04/29/2025, 1:46 PM