Files
C-Plus-Plus/math
Stressed 17a532637a feat: add Iterative Factorial (#2453)
* Feat: Iterative factorial

* Test: Added tests for iterative factorial

* Fix: Added throw when argument exceeds maximum
Docs: Updated docs to to explain why maximum is 20

* Feat: iterative_factorial
docs: Added documentation to some functions.
test: Added exception test.

* chore: Fixed formatting

* docs: Added documentation, changed examples.

* Update math/iterative_factorial.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Update math/iterative_factorial.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Update math/iterative_factorial.cpp

Co-authored-by: David Leal <halfpacho@gmail.com>

* Update math/iterative_factorial.cpp

Co-authored-by: David Leal <halfpacho@gmail.com>

* chore: apply suggestions from code review

* Update math/iterative_factorial.cpp

Co-authored-by: David Leal <halfpacho@gmail.com>

* Update math/iterative_factorial.cpp

Co-authored-by: Taj <tjgurwara99@users.noreply.github.com>

* Fix: Exception test termination bug

* Update math/iterative_factorial.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

* Update math/iterative_factorial.cpp

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>

---------

Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: Taj <tjgurwara99@users.noreply.github.com>
2023-07-20 22:45:57 -06:00
..
2020-06-22 16:21:57 -04:00
2020-11-25 04:18:50 -05:00
2020-11-22 23:05:01 +05:30
2020-10-27 06:33:29 +05:30
2022-02-02 11:02:02 +05:30
2020-06-23 15:13:28 -05:00
2021-10-26 13:19:58 +05:30

Prime factorization

Prime Factorization is a very important and useful technique to factorize any number into its prime factors. It has various applications in the field of number theory.

The method of prime factorization involves two function calls. First: Calculating all the prime number up till a certain range using the standard Sieve of Eratosthenes.

Second: Using the prime numbers to reduce the the given number and thus find all its prime factors.

The complexity of the solution involves approx. O(n logn) in calculating sieve of eratosthenes O(log n) in calculating the prime factors of the number. So in total approx. O(n logn).

Requirements: For compile you need the compiler flag for C++ 11