Is the sorting algorithm used by .NET's `Array.Sort()` method a stable algorithm?

前端 未结 5 1167
灰色年华
灰色年华 2020-11-29 07:44

Is the sorting algorithm used by .NET\'s Array.Sort() method a stable algorithm?

5条回答
  •  感情败类
    2020-11-29 08:42

    As other answers have stated, Array.Sort isn't stable. However, the LINQ OrderBy methods (and OrderByDescending etc) are stable, which can be very useful.

提交回复
热议问题