This design is not standardized and currently unstable.
We implement a bubble sorting algorithm on an array of u32 elements. Bubble sort is a standard algorithm that works by examining each set of adjacent elements, from left to right, and swapping positions if they are out of order. This process is repeated until there are no more swaps to be made, resulting in a sorted array.
The bubble sort function below takes as input a mutable array of ten u32 elements, and returns a sorted array of the same size.
We provide below a example test function for checking the correctness of the bubble sort function, which when ran, outputs the results to the console, as shown in the following block.
The full code is outlined below: