Sorting
Sorting is a process of organizing a data set by a selected criterion. The most common types of arrangement are numeric (numerical) and alphabetical (lexical). For both types of sorting, sorting ascending (from lowest to highest) or descending (from highest to lowest) can be used.
The use of a sorting algorithm, for example, makes it easier to search in an array of elements when array layouts increase search efficiency, reduce its time, and require less memory. Based on our knowledge of the arrays we know that each element has its index that determines it. It can also be used for sorting.
There are several kinds of
sorting algorithms that are specified by the properties of the arrays
and their input data on which they are sorted. Internal sorting
algorithms are used in operating memory; external sorting algorithms,
in turn, use external storage media.