Click here to Skip to main content
16,022,536 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

Can you please explain Array.Sort() method uses which sorting mechanism of DataStrcutures. i Hope it was done based on Bubble sort(). please correct me if i am wrong.

Thanks,
Regards.,
Posted

Hi
Array.Sort is not based on some algorithm, it is based on IComparable Interface, please check this msdn site for details
 
Share this answer
 
v2
Have a look yourself about what is used in Array.Sort here:
MSDN Array.Sort()[^]

If you know what Bubble Sort is, you should know that the time & space complexities of it is not good. There are better algorithms than that.
If Microsoft used any algorithm for sorting then they would they use a bad performance algo?
It uses IComparable interface. You can find the implementation example in the above link.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900