IComprable interface.
All of the primitive data types in .NET - String, Integer, Double, etc. - implement
IComparable and therefore arrays of these types can be sorted using
Array.Sort(ArrayName).
Unsorted List of Random Numbers
| 26 |
| 34 |
| 95 |
| 2 |
| 21 |
| 53 |
| 30 |
| 85 |
| 97 |
| 82 |
| 74 |
Sorted List of Random Numbers
| 2 |
| 21 |
| 26 |
| 30 |
| 34 |
| 53 |
| 74 |
| 82 |
| 85 |
| 95 |
| 97 |
Source Code
|