Why a programmer would prefer O(N^3) instead of O(N^2)
algorithm, big-o, time, time-complexity
Solution
I can think of the following three reasons:
- Ease of initial implementation.
- Ease of maintenance in the future.
- The O(N^3) algorithm may have a lower space complexity than the O(N^2) algorithm (i.e., it uses less memory).
Problem
I was studying for my final exam and there is a question in the archive that I cannot find its answer: The order-of-growth of the running time of one algorithm is O(N^2); the order-of-growth of the running time of a second algorithm is O(N^3). List three compelling (logical, convincing) reasons why a programmer would prefer to use the O(N^3) algorithm instead of the O(N^2) one.