Time Complexity (Big O) - Can value of N decides whether the time complexity is O(1) or O(N) when we have 2 nested FOR loops?

前端 未结 0 1120
被撕碎了的回忆
被撕碎了的回忆 2021-01-06 14:18

Suppose that I have 2 nested for loops, and 1 array of size N as shown in my code below:

int result = 0;

for( int i = 0; i < N ; i++)
{
    for( int j = i         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题