Sorting of an array

Sorting of an array is arranging of its members in a ascending or descending order. This can be achieved in many ways, and in the text that follows you will see one of the variants of the algorithm called Bubble Sort. It works by running two loops and then, depending on their index values, corresponding members of the array are compared. If the condition is met they change places. The procedure is repeated until the comparison is completed, and array sorted.