Factorial
Multiplying a number by every smaller one down to 1. It's written n! and counts how many ways n things can be ordered.
Example
4! = 4 × 3 × 2 × 1 = 24: there are 24 ways to order 4 books on a shelf. With 10 books it's 3,628,800.
Test yourself: Factorial
Time complexity
With 3 elements A, B and C there are ___ possible orders.
3! = 3 × 2 × 1 = 6: ABC, ACB, BAC, BCA, CAB and CBA.
0/1
â–¶ Play