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

tennenrishintennenrishin Member Posts: 177  Maven
edited November 2018 in Help
Does the Sort operator perform a stable sort?

Answers

  • Nils_WoehlerNils_Woehler Member Posts: 463  Guru
    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
  • tennenrishintennenrishin Member Posts: 177  Maven
    Thank you Nils!
Sign In or Register to comment.