Arranging elements from smallest to largest (ascending) or largest to smallest(descending) is called sorting.
There are two sorting methods
1. Bubble sort:
It is a simple sorting method. In this sorting considering two adjacent elements if it is out of order, the elements are interchanged. After the first iteration the largest(in the case of ascending sorting) or smallest(in the case of descending sorting) will be the end of the array. This process continues.
2. Selection sort:
In selection sort the array is divided into two parts, the sorted part and unsorted part. First smallest element in the unsorted part is searched and exchanged with the first element. Now there is 2 parts sorted part and unsorted part. This process continues.