Sort() - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Sort()

MeirikMeirik Posts: 1Member
Hi i just whant to know what algoritem they are using in Array.Sort(). It's fast.

Comments

  • ing_gigioing_gigio Posts: 31Member
    : Hi i just whant to know what algoritem they are using in Array.Sort(). It's fast.
    :

    I cite literally 2 sentences from the .Net documentation (this was found in the description Array.Sort() method)

    "
    This method uses the QuickSort algorithm. This is an O(n ^2) operation, where n is the number of elements to sort, with an average of θ(n log n).

    This implementation performs an unstable sort; that is, if two elements are equal, their order might not be preserved. In contrast, a stable sort preserves the order of elements that are equal.
    "
Sign In or Register to comment.