TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
|
Prime factorization of positive integers. More...
#include <algorithm>
#include <cstring>
#include <iostream>
#include <vector>
Go to the source code of this file.
Functions | |
void | SieveOfEratosthenes (int N) |
void | prime_factorization (int num) |
int | main () |
Variables | |
bool | isprime [1000006] |
std::vector< int > | prime_numbers |
std::vector< std::pair< int, int > > | factors |
Prime factorization of positive integers.
Definition in file prime_factorization.cpp.
int main | ( | void | ) |
Main program
Definition at line 62 of file prime_factorization.cpp.
void prime_factorization | ( | int | num | ) |
Prime factorization of a number
Definition at line 40 of file prime_factorization.cpp.
void SieveOfEratosthenes | ( | int | N | ) |
Calculating prime number upto a given range
Definition at line 23 of file prime_factorization.cpp.
std::vector<std::pair<int, int> > factors |
list of prime factor-pairs
Definition at line 19 of file prime_factorization.cpp.
bool isprime[1000006] |
Declaring variables for maintaing prime numbers and to check whether a number is prime or not
Definition at line 13 of file prime_factorization.cpp.
std::vector<int> prime_numbers |
list of prime numbers
Definition at line 16 of file prime_factorization.cpp.