Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道这两个独立程序的一般运行时间。我一直在努力计算它们的方法。
问题1
y = 0.5; for (j = 0; j < N; j = j + y) { operation(); y = 2*y; }
问题 2
s1 = 1; s2 = 1; for (i = 1; i <= N; i++ ) { for (j = 0; j < s2; j++) { operation(); } x = s1 + s2; s1 = s2; s2 = x; }