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
| 53 |
| 40 |
| 53 |
| 42 |
| 5 |
| 44 |
| 56 |
| 57 |
| 98 |
| 16 |
| 72 |
Sorted List of Random Numbers
| 5 |
| 16 |
| 40 |
| 42 |
| 44 |
| 53 |
| 53 |
| 56 |
| 57 |
| 72 |
| 98 |
Source Code
|