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

Array.Sort() chooses one of three sorting algorithm, depending on the size of the input:

  1. If the size is fewer than 16 elements, it uses an insertion sort algorithm.
  2. If the size exceeds 2 * log^N, where N is the range of the input array, it uses a Heap Sort algorithm.
  3. Otherwise, it uses a Quicksort algorithm

Source: Array.Sort(Array) Method on MSDN.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)