Can anyone please let me what would be big O time complexity for the following piece of code:
for (int i = 0; i < array.length - 1; i++) {
for (int j = i + 1; j < array.length; j++) {
// do something
}
}
It can't be O(n^2)
since j = i + 1
? Thanks!