How can I sort an array in, for example, a-/de-scending order?
I thought of a way, using nested loops and if statements, but it's very inefficient, and there is most probably an easier way.
Thanks.
google "sorting algorithms"
there are gazillions ranging from O(n log n) to O(n^2).
bubble sort, insertion sort, radix sort, merge sort, quick sort, shell sort, etc, etc, etc, etc.