以下循环的时间复杂度是多少?

use*_*343 -1 c++ big-o time-complexity

for (int i=0; i<N; i++)
 for (int j=i; j<N; j++)
  fun1(i,j);
Run Code Online (Sandbox Code Playgroud)

上面是嵌套的for循环.第一个for循环从0变为N,第二个for循环从i变为N.上述代码的时间复杂度是多少?

编辑:fun1是o(1)

Ian*_*ros 5

O(N²*O(乐趣)).显然答案取决于乐趣的复杂性.

编辑:作为fun()= O(1),复杂性循环复杂度为O(n²)