## PHP and bubble sort

Sorting algorithms are very classical means of manipulating a set of objects to obtain an ordered sequence of these objects. The method we are going to present involves sorting the array in ascending order, using the fact that at each step, all elements in the visited part of the array actually form a sequence of pairs that can be ordered. We don’t just identify the maximum value at each pass, but we also sort the elements of each pair. This may eventually reduce the number of passes required.

Continuer la lecture