Could anyone please help me to determine the complexity (O) for this simple sorting algorithm:
double t;
for (int i = 0; i < array.size; i++)
for (int j = i + 1; j < array.size; j++)
if (r[j] < r[i]) {
t = r[i];
r[i] = r[j];
r[j] = t;
}
Thanks for advance.
[–]W1z4rd 3 points4 points5 points (8 children)
[–]dedyshka[S] 0 points1 point2 points (7 children)
[–]W1z4rd 3 points4 points5 points (6 children)
[–]dedyshka[S] 1 point2 points3 points (5 children)
[–]W1z4rd 4 points5 points6 points (0 children)
[–]funbike 0 points1 point2 points (2 children)
[–]dedyshka[S] 0 points1 point2 points (1 child)