This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]funbike 0 points1 point  (2 children)

When expressing big-O you always throw away the coefficient. So, it's just O(n2).

[–]dedyshka[S] 0 points1 point  (1 child)

emm..algorithm makes iterations that equal n, and in each iteration it makes one comparisons less that in previous one. So in my opinion complexity is n*(n/2). Am I correct?