Name Gender School Position Salary
-----------------------------------------------------------
Alex Male Computing Lecturer $80,000
Bob Male Mathematics Lecturer $60,000
Carol Female
我知道这很容易,但我的教科书并没有讨论带有do-while循环的Big-Oh命令,也没有使用我的其他算法源。 此问题表明以下代码片段参数化变量“n”,并且还需要紧上限。 int i=0, j=0;
do {
do {
System.out.println("...looping..."); //growth should be measured in calls t
2^n −8 = O(2^n)
It says there are some positive constants c and n0 for which
0 <= f(n) <= cg(n) for all n >= n0
我解决它: 2^n −8 <= c2^n
If c = 1, and n0 = 1
1-8 <= 1*1
-7<= 1
then for all n >= n0