小编Dic*_*ldi的帖子

时间复杂度嵌套循环内循环+外循环

谁能解释一下这个算法的时间复杂度是多少?

for (i = 1; i <= n; i++){
    for(j = 1; j <= n; j += i) {   // note: not j++
        printf("Iteration %d : %d\n", i, j);   
    }
}
Run Code Online (Sandbox Code Playgroud)

c big-o time-complexity

3
推荐指数
1
解决办法
227
查看次数

标签 统计

big-o ×1

c ×1

time-complexity ×1