What does it mean to "sort an array", either by rows or columns?

What does it mean to "sort an array", either by rows or columns?

Author: Maniero, 2018-07-04

1 answers

Probably a wrong way to say "sort every element of a row or a column of an array". See What is the difference between ordered, unordered and sorted?. Everyone talks wrong. In order it is already, it is not classified. You can't order something that already has an order. In English you would say sorting a matrix, not say ordering a matrix.

Then you take a sequence of values, probably numbers, which is in any order, it analyzes each of them, brings to the beginning the smaller values, and sends to the end the larger values, so at the end each next element will always be greater than the previous one, sine the first the smallest of all and the last the largest of all. It is also possible to sort in a descending way and the first is the largest and the last the smallest.

If it is not numbers the classification of being lexicographic, i.e. popularly alphabetically. If it is another type of data has to determine how it classifies.

One thing that can happen is to use more than one element as a criterion, so you would have to adopt one criterion, it could be just looking at the first element of the row or column, the sum, or something else.

 3
Author: Maniero, 2018-07-04 03:57:55