O(n!) Factorial

Back to Common Classes

Factorial time complexity. Grows faster than exponential. Arises in problems that enumerate all permutations, such as brute-force solutions to the traveling salesman problem. Impractical for all but the smallest inputs (n > 20 is typically infeasible).

computational-complexity time-complexity factorial