From e9278b805d6b824e57be19ce701be380ff8d3dfc Mon Sep 17 00:00:00 2001 From: Mayada <115709272+Maddily@users.noreply.github.com> Date: Fri, 4 Oct 2024 12:46:59 +0300 Subject: [PATCH 1/2] Update the definition of a factorial --- javascript/computer_science/time_complexity.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript/computer_science/time_complexity.md b/javascript/computer_science/time_complexity.md index 3b4f9ed616..ab960d0468 100644 --- a/javascript/computer_science/time_complexity.md +++ b/javascript/computer_science/time_complexity.md @@ -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. From 6288eff88486237c5d8e86a73a532a5a91c5198e Mon Sep 17 00:00:00 2001 From: Mayada <115709272+Maddily@users.noreply.github.com> Date: Fri, 4 Oct 2024 12:47:03 +0300 Subject: [PATCH 2/2] Update the definition of a factorial --- ruby/computer_science/time_complexity.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruby/computer_science/time_complexity.md b/ruby/computer_science/time_complexity.md index 86e1ee46f7..4bb99c7c10 100644 --- a/ruby/computer_science/time_complexity.md +++ b/ruby/computer_science/time_complexity.md @@ -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.