data-structures · intermediate · ~15 min
Implement a simple comparison sort.
Implement void bubble_sort(int *a, int n) sorting the first n elements in ascending order in place.
void bubble_sort(int *a, int n) {
/* TODO */
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.