Untitled
Anonymous
plain_text
03/30/2023 3:50 PM
344 B
28
Indexable
void sort(int n, int *a) {
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n; j++) {
if (a[i] > a[j]) { //swap
int t = a[i];
a[i] = a[j];
a[j] = t;
}
}
}
}Editor is loading...