标签:big o notation c++ 学习
这里列出了一些难做的题或是易错的题,简单的我就没有过多的解释,但是如果大家有任何问题都可以私信我或是评论一下,我会尽量即时的解答问题或是疑问的。
int x=0;
for(int i=4*n; i>=1; i--)
O(n)
The loop runs O(n) times and does O(1) work per iteration.}
Think about the values of i as the loop progresses. It will take on the series of values 1, 3, 9, 27, 81, 243, ..., 3k. Since i is tripling on each iteration, it takes on successive powers of three.
b=b+5;
s++;
s++;
第二章 Big O notation 试题以及讲解 (包会)
标签:big o notation c++ 学习
原文地址:http://blog.csdn.net/u013152895/article/details/44116271