Sorting a list by decreasing order

### 6.3.19 Sorting a list by decreasing order

The SortD command sorts a list or a matrix in decreasing order.

- SortD takes L, a list.
- If L is not a matrix, then SortA(L) returns a copy of L with the elements in decreasing order.
- If L is a matrix, then SortA(L) returns a copy of L with columns sorted according to decreasing order in the first row.

#### Examples

SortD([3,4,2])

| ⎡ ⎣ | 4,3,2 | ⎤ ⎦

SortD([[3,4,2],[6,4,5]])

⎡ ⎢ ⎣ |
4 | 3 | 2
4 | 6 | 5
| ⎤ ⎥ ⎦