C # Sorting question
5 answers
Both lists and arrays can be sorted like other data structures.
Sorting efficiency depends on what kind of data you are sorting and what sorting algorithm you are using.
This site gives a good demo of the various sorting algorithms (click on the green initials to start the demo).
+3
a source to share
The default implementation is quicksort for containers such as List <>. Quicksort is O (n * Ln (n)). In most cases, this is a good choice. It's a bit slower on small amounts of data and then on O (n * n) algorithms, and sometimes not so good on special data types where you'd be better off using special sorting algorithms (suppose you can implement them yourself or use 3- d party framework)
+1
a source to share