This consists of n rounds. On each round, the algorithm iterates through the elements of the array. When two elements are not in the correct order, they swap.
for (int i = 0; i < n; i++) {
for (int j = 0; j < n-1; j++) {
if (array[j] > array[j+1]) {
swap(array[j],array[j+1]);
}
}
}