[swift-evolution] Add stableSort() to the standard library.

Davide Italiano dccitaliano at gmail.com
Mon Jan 11 12:30:53 CST 2016


On Mon, Jan 11, 2016 at 9:51 AM, Kenny Leung via swift-evolution
<swift-evolution at swift.org> wrote:
> I can’t imagine a case where one wouldn’t want this, so why not just replace the existing sort with the stable sort?
>

Unstable sort and stable sort come with different time/space
computational complexity tradeoffs. In general you might be faster if
you don't care about relative order of elements with the same keys and
some (most?) consumers don't. So, I don't think it's an option
providing only stable sort.


More information about the swift-evolution mailing list