Factorial

Last updated

What is Factorial?

Factorial, often denoted as n!, is a mathematical operation. In the context of computer science and algorithm complexity, it represents an extremely high growth rate. This occurs because of the way a factorial is calculated: The product of all positive integers less than or equal to a non-negative integer n. Thus, if an algorithm has a complexity of O(n!), it means the running time increases factorially based on the size of the input data set. That is, for an input of size n, the algorithm does n * (n-1) * (n-2) * ... * 1 operations. O(n!) is essentially the worst case scenario of complexity for an algorithm and is seen in brute-force search algorithms, such as the traveling salesman problem via brute-force.

More in stage 6: Algorithmic Complexity

Factorial: common questions

Can I learn Factorial in Hindi?

This lesson is written in English. Once you sign in, open it in the interactive course and ask the AI tutor to explain Factorial in Hindi or Hinglish. The tutor answers from this lesson’s own text, so it stays on the syllabus, and it runs on your own Google, OpenAI or Anthropic key.

Is this Factorial tutorial for beginners?

It is lesson 37 of 107 in the free Data Structures & Algorithms roadmap, in stage 6, Algorithmic Complexity. If you are new to Data Structures & Algorithms, start from stage 1 and come back here in order; if you already know the earlier stages, this lesson stands on its own.

Still confused? Ask me