A Sorting Algorithm is used to rearrange a given array or list of elements in an order. For example, a given array [10, 20, 5, 2] becomes [2, 5, 10, 20] after sorting in increasing order and becomes [20, 10, 5, 2] after sorting in decreasing order.
A sorting algorithm is used to arrange elements of an array/list in a specific order. In this article, you will learn what sorting algorithm is and different sorting algorithms.