217k views
4 votes
Consider an algorithm that you are told has worst case time complexity that is O(N³). Which of the following is also a valid (but not necessarily good) description of the worst case time complexity for this algorithm?

a) O(N²)
b) O(N log N)
c) O(N)
d) O(1)

1 Answer

4 votes

Final answer:

The worst case time complexity of O(N³) cannot be validly described by any better complexities such as O(N²), O(N log N), O(N), or O(1), as they suggest a more efficient performance than permissible by O(N³).

Step-by-step explanation:

When considering the worst case time complexity of O(N³), we cannot necessarily claim that the complexities O(N²), O(N log N), O(N), or O(1) also accurately describe this algorithm's performance. These alternatives are strictly better (i.e., they imply a faster algorithm) than O(N³), which defines an upper bound on the runtime as the size of the input (N) grows. Since an algorithm that has a worst case of O(N³) will not perform any better than that, we cannot validly assert that its complexity is O(N²), O(N log N), O(N), or O(1), as these would suggest a more efficient computation than what is defined by O(N³).

User Schanti Schul
by
7.7k points