以下嵌套循环的Big-O时间复杂度是多少:
for(int i = 0; i < N; i++) { for(int j = i + 1; j < N; j++) { System.out.println("i = " + i + " j = " + j); } }
它还是O(N ^ 2)吗?
big-o nested-loops
big-o ×1
nested-loops ×1