big o - Big-Oh Notation problem -
i think big-o notation n^2, im not sure.
for (int = 0; < n -1; i++) { (int j = 0; j < n – 1; j++) if (x[j] > x[j+1]) { temp = x[j]; x[j] = x[j+1]; x[j+1] = temp; } }
you doing n * (n * (4)) operations = o(n^2)
Comments
Post a Comment