Is it O(n) or O(n*logn) of the code below:
for(int j=n, int sum = 0; j>0 ; j--)
for(int k=j; k >0; k--) sum++;
List of iterations:
j = 5: k = 5, 4, 3, 2, 1
j = 4: k = 4, 3, 2, 1,
j = 3: k = 3, 2, 1
j = 2: k = 2, 1
j = 1: k = 1
We have 15 iterations in total.
But, if it is O(n), then only 5 iterations must be.
And if it is O(n*logn) answer would be only around 11-12 iterations.
