What is it?

A sorting algorithm is a set of instructions that rearrange an array in a particular order, normally set as ascending or descending. This depends on the nature of the array type.

For numerical arrays, one could just apply an ascending rule, but the same would need changes to work with string arrays.

There are various sorting methods, with each having it’s own benefits, from memory and CPU usage to time complexity, normally measured in Big-O Notation.