TheAlgorithms-C-Plus-Plus/Math/Prime_Factorization
linus-xuzixuan 4fe2cf67b9
Edits #include directives
My computer doesn't seem to have the stdc++.h, so I tried changing it to the two headers really used.
2018-04-22 00:52:40 +08:00
..
primefactorization.cpp Edits #include directives 2018-04-22 00:52:40 +08:00
README.md Update README.md 2017-12-23 22:53:02 +01:00

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