From b4ed3bc8559f46e216d9001bb8ca938b70f28182 Mon Sep 17 00:00:00 2001 From: Mayada <115709272+Maddily@users.noreply.github.com> Date: Fri, 4 Oct 2024 20:18:17 +0300 Subject: [PATCH] Time Complexity: Update the definition of a factorial (#28914) * Update the definition of a factorial * Update the definition of a factorial --- javascript/computer_science/time_complexity.md | 2 +- ruby/computer_science/time_complexity.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/javascript/computer_science/time_complexity.md b/javascript/computer_science/time_complexity.md index 688036aa59..b8bf2a60d2 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. diff --git a/ruby/computer_science/time_complexity.md b/ruby/computer_science/time_complexity.md index a98b8cd0a8..8f73eff5dc 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.