🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

[SOLVED] Does the Sort operator perform a stable sort?

User: "tennenrishin"
New Altair Community Member
Updated by Jocelyn
Does the Sort operator perform a stable sort?

Find more posts tagged with

Sort by:
1 - 2 of 21
    User: "Nils_Woehler"
    New Altair Community Member
    Hi,

    the sort operator uses the Collections.sort() method from Java. From the Java API it says:

    This sort is guaranteed to be stable: equal elements will not be reordered as a result of the sort.
    So yes, the sorting is stable.

    Best,
    Nils
    User: "tennenrishin"
    New Altair Community Member
    OP
    Thank you Nils!