yes O (n ^ 2), just sum the number of iterations in the inner loop:
n + (n - 1) + (n - 2) + ... 1 = [ n x (n + 1) ] / 2
and if it is not a cycle, it is a management structure. usually you just count the number of times a condition is checked without considering the condition. The condition may be important if there is another loop in the if body.
how to calculate iterations of the inner loop:
i = 0 n ,i = 1 n - 1 ,i = 2 n - 2 ,- ....
i = n - 2 1 timesi = n - 1 0
, , :
n + (n - 1) + (n - 2) + ... 1 = [ n x (n + 1) ] / 2