I'm a beginner in programming and was just playing with sorting and made this algorithm. It is similar to bubble, but it compares not the adjacent pairs but pairs like: first and second, first and third.... second and third, second and fourth and so on. Could you tell me what is the performance/efficiency of the algorithm or compare it to bubble? Or at least advice me on how to solve the problem myself. I'm interested in how much bubble is better than this one. Thank you.
void sortArray(int a[]) {
int q, x, temp;
for ( q = 0; q < SIZE - 1; q++ ) {
for ( x = q + 1; x < SIZE; x++ ) {
if (a[q] < a[x]) {
temp = a[q];
a[q] = a[x];
a[x] = temp;
}
}
}
}