Which sorting algorithm is used by .NET's Array.Sort() method?

Mizanur Rahman 21 Reputation points
2022-01-13T17:52:07.66+00:00

It uses the QuickSort algorithm.

Is it true?

Developer technologies ASP.NET ASP.NET Core
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. AgaveJoe 30,126 Reputation points
    2022-01-13T18:29:31.823+00:00
    1 person found this answer helpful.
    0 comments No comments

  2. Michael Taylor 60,161 Reputation points
    2022-01-13T18:45:25.013+00:00

    As discussed in the docs for this method it depends on what version you're talking about. .NET Framework versions prior to 4.5 used quick sort. Starting with .NET 4.5 it uses introspective sorting. Refer to the docs for links on the algorithms.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.