Originally Posted by

**tabstop**
Do you mean how much one instance of the loop will take, or the whole code at once?

One go-round of the inner loop is quite obviously O(j). The first time j is 0, then 1, then 2, then 3, then 4, then 5, then ..., then n*n. So one go-round of the middle loop will involve (0+1+2+3+4+5+...+n*n) operations.

And then the outer loop will run the middle loop n times (since the middle loop doesn't depend on i in any way shape or form, it will run exactly the same way each time). So take the number from above and multiply by n.