79.6k views
4 votes
Q#1: Suppose that you have two different algorithms for solving a problem. To solve a problem of size n, the first algorithm uses exactly n*exp1-[n+2n+3n+4n]/nlne(10) operations and the second algorithm uses exactly n! operations. As n grows, which algorithm uses fewer operations?

1 Answer

8 votes

Answer:

The one of -[n+2n+3n+4n]/nlne(10) has fewer operations because the value of n is static.

The one of n! ( factorial ) is factorised up to n∞ hence has infinity operations.

User YAMAMOTO Yuji
by
7.8k points