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