Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time Complexity: Update the definition of a factorial #28914

Merged
merged 2 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion javascript/computer_science/time_complexity.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ You want to avoid this if at all possible, otherwise you won't be processing muc

#### O(N!) - Factorial complexity

A factorial is the product of the sequence of *n* integers. The factorial of 4(4!) is 4 \* 3 \* 2 \* 1.
The factorial of a number is the product of all numbers between 1 and that number. The factorial of 4(4!) is 4 \* 3 \* 2 \* 1.

You will come across Factorial Complexity if you ever need to calculate permutations or combinations. If you have an array and have to work out all the combinations you can make from the array, that is a Factorial complexity. It's manageable for a small number of items, but the leap with each new item in a dataset can be huge.

Expand Down
2 changes: 1 addition & 1 deletion ruby/computer_science/time_complexity.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ You want to avoid this if at all possible, otherwise you won't be processing muc

#### O(N!) - factorial complexity

A factorial is the product of the sequence of *n* integers. For example, the factorial of 4 (written as 4!) is 4 \* 3 \* 2 \* 1.
The factorial of a number is the product of all numbers between 1 and that number. For example, the factorial of 4 (written as 4!) is 4 \* 3 \* 2 \* 1.

You will come across Factorial Complexity if you ever need to calculate permutations or combinations. If you have an array and have to work out all the combinations you can make from the array, that is a Factorial complexity. It's manageable for a small number of items, but the leap with each new item in a dataset can be huge.

Expand Down
Loading