Questions and Correct Answers | New
Update
What is the run-time efficiency of the following program?
for(i = 1; i <= n; i++)
printf("%d", i); - 🧠 ANSWER ✔✔O(n)
Calculate the run-time efficiency of the following program segment
for(i = 1; i <= n; i++)
for(j = 1; j <= n; j++)
for(k = 1; k <= n; k++)
, printf("%d %d %d\n", i, j, k); - 🧠 ANSWER ✔✔O(n^3)
If the algorithm doIT has an efficiency factor of 5n, calculate the run-time
efficiency of the following program segment:
for(i = 1; i <= n; i++)
doIT(...); - 🧠 ANSWER ✔✔O(n^2)
The big-O notation for the following expression 5n^2 + n^3 + 4(logn)n^2 is?
- 🧠 ANSWER ✔✔O(n^3)
Calculate the run-time efficiency of the following program segment:
for(i = 1; i <= n; i++)
for(j = 1; j <= 1; j++)
for(k = 1; k <= n; k=k*2)
x++; - 🧠 ANSWER ✔✔O(n^2*logn)
True or False: With abstract data types, outsider programs will not know
the detailed implementations but the interfaces. - 🧠 ANSWER ✔✔True