Math Fundamentals18 sections · 814 units
Open in Course

O(n!) - Factorial Time

(All permutations)

An algorithm is O(n!) if it generates all permutations of n items. Factorial grows even faster than exponential.

10! is 3,628,800. 15! is over 1 trillion. Factorial algorithms are only viable for tiny inputs.

Traveling salesman via brute force checking all routes is O(n!). You need smarter approaches.