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

前端 未结 6 751
悲&欢浪女
悲&欢浪女 2021-02-12 15:44

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

6条回答
  •  暖寄归人
    2021-02-12 16:11

    Actually, It's not that easy as it's seems. It looks like .NET is implementing a set of different sorting algorithms depending on the input and his size. I used to decompile Array.Sort() from CLR and it seems that they are using both Heap, Insertion and Quicksort. enter image description here

提交回复
热议问题