Answer:
- A: O(N³)
- B: O(N)
- Algorithm B is more efficient than Algorithm A
- N ≥ 5 and ≤ 15
- N ≤ 4 or ≥ 16
Step-by-step explanation:
You want to compare the theoretical performance and actual performance of Algorithm A, which requires N³/75 -N²/4 +N +10 steps, and Algorithm B, which requires N/2 +8 steps.
Theoretical performance
The theoretical performance of an algorithm is generally described by the shape of the performance curve when N gets large. Constant factors are generally ignored. When the number of steps is described by a polynomial, the performance is described by the highest-degree term.
- Algorithm A: O(N³)
- Algorithm B: O(N)
The number of steps increases faster for large N using algorithm A, so we conclude that ...
Algorithm B is more efficient than Algorithm A
Practical performance
When we plot the number of algorithm steps versus N on a graph, as in the attachment, we find that Algorithm B takes more steps for specific values of N. For those values, Algorithm A outperforms Algorithm B.
- A outperforms B where N ≥ 5 and N ≤ 15
- B outperforms A where N ≤ 4 or N ≥ 16
__
Additional comment
We presume that the problem size is measured using integer values of N. That is why we have used integer values in the answers to the practical performance questions. The graph shows the boundary values to 3 decimal places if needed. (As, for example, if N is measured in thousands.)
Algorithm performance can follow a number of different curves. The usual ones are polynomial, exponential, logarithmic, or some product of these, as O(N·log(N)), for example.