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

tennenrishin
tennenrishin New Altair Community Member
edited November 5 in Community Q&A
Does the Sort operator perform a stable sort?
Tagged:

Answers

  • Nils_Woehler
    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
  • tennenrishin
    tennenrishin New Altair Community Member
    Thank you Nils!