diff --git a/d8/d9c/union__of__two__arrays_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map b/d8/d9c/union__of__two__arrays_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map index 963d3ffb5..73de03a59 100644 --- a/d8/d9c/union__of__two__arrays_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map +++ b/d8/d9c/union__of__two__arrays_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map @@ -12,7 +12,7 @@ - + diff --git a/d8/d9c/union__of__two__arrays_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 b/d8/d9c/union__of__two__arrays_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 index b68d2ff23..8769d2c9a 100644 --- a/d8/d9c/union__of__two__arrays_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 +++ b/d8/d9c/union__of__two__arrays_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 @@ -1 +1 @@ -dd7e1d2eb4a0e958401a396a3f72dc22 \ No newline at end of file +35506b55f9d68224f3d831d50486bbee \ No newline at end of file diff --git a/d8/d9c/union__of__two__arrays_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg b/d8/d9c/union__of__two__arrays_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg index 79c8f69a0..9bcac4954 100644 --- a/d8/d9c/union__of__two__arrays_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg +++ b/d8/d9c/union__of__two__arrays_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg @@ -214,7 +214,7 @@ Node12 - + is_prime diff --git a/d8/d9c/union__of__two__arrays_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d8/d9c/union__of__two__arrays_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map index 2290ba5d5..012fea24a 100644 --- a/d8/d9c/union__of__two__arrays_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map +++ b/d8/d9c/union__of__two__arrays_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -13,7 +13,7 @@ - + diff --git a/d8/d9c/union__of__two__arrays_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d8/d9c/union__of__two__arrays_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 index f6063aa31..7cc4f3a74 100644 --- a/d8/d9c/union__of__two__arrays_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 +++ b/d8/d9c/union__of__two__arrays_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -1 +1 @@ -91a255ed58ff67d3fda69b096a388299 \ No newline at end of file +57684c2816bfd490273435a926fa3e0e \ No newline at end of file diff --git a/d8/d9c/union__of__two__arrays_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d8/d9c/union__of__two__arrays_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index c0f61ecff..76d73b445 100644 --- a/d8/d9c/union__of__two__arrays_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/d8/d9c/union__of__two__arrays_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -275,7 +275,7 @@ var sectionId = 'dynsection-1'; Node13 - + is_prime diff --git a/d8/d9c/union__of__two__arrays_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg b/d8/d9c/union__of__two__arrays_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg index ca6fa2360..4bd65bd0a 100644 --- a/d8/d9c/union__of__two__arrays_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg +++ b/d8/d9c/union__of__two__arrays_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg @@ -229,7 +229,7 @@ Node13 - + is_prime diff --git a/d8/ddf/sieve__of__eratosthenes_8cpp.html b/d8/ddf/sieve__of__eratosthenes_8cpp.html index 4f4ad199f..54e7075da 100644 --- a/d8/ddf/sieve__of__eratosthenes_8cpp.html +++ b/d8/ddf/sieve__of__eratosthenes_8cpp.html @@ -150,7 +150,7 @@ Space Complexity : \(O(N)\)

70 print(N, is_prime);
71 return 0;
72}
-
bool is_prime(T num)
Definition: check_prime.cpp:22
+
bool is_prime(T num)
for IO operations
Definition: check_prime.cpp:23
constexpr uint32_t N
A struct to represent sparse table for min() as their invariant function, for the given array A....
Definition: sparse_table.cpp:47
void print(uint32_t N, const std::vector< bool > &is_prime)
Definition: sieve_of_eratosthenes.cpp:44
std::vector< bool > sieve(uint32_t N)
Definition: sieve_of_eratosthenes.cpp:26
diff --git a/d8/ddf/sieve__of__eratosthenes_8cpp_a235843bdf82d2a6cc8596ae8fd3b8df9_cgraph.map b/d8/ddf/sieve__of__eratosthenes_8cpp_a235843bdf82d2a6cc8596ae8fd3b8df9_cgraph.map index 1fb9626e7..885f183a2 100644 --- a/d8/ddf/sieve__of__eratosthenes_8cpp_a235843bdf82d2a6cc8596ae8fd3b8df9_cgraph.map +++ b/d8/ddf/sieve__of__eratosthenes_8cpp_a235843bdf82d2a6cc8596ae8fd3b8df9_cgraph.map @@ -1,5 +1,5 @@ - + diff --git a/d8/ddf/sieve__of__eratosthenes_8cpp_a235843bdf82d2a6cc8596ae8fd3b8df9_cgraph.md5 b/d8/ddf/sieve__of__eratosthenes_8cpp_a235843bdf82d2a6cc8596ae8fd3b8df9_cgraph.md5 index 20c6a4d27..b2606d847 100644 --- a/d8/ddf/sieve__of__eratosthenes_8cpp_a235843bdf82d2a6cc8596ae8fd3b8df9_cgraph.md5 +++ b/d8/ddf/sieve__of__eratosthenes_8cpp_a235843bdf82d2a6cc8596ae8fd3b8df9_cgraph.md5 @@ -1 +1 @@ -2f8c2e90a637c569a4e48c4d25266a85 \ No newline at end of file +71753a305e9935c61c80adff5939fd9a \ No newline at end of file diff --git a/d8/ddf/sieve__of__eratosthenes_8cpp_a235843bdf82d2a6cc8596ae8fd3b8df9_cgraph.svg b/d8/ddf/sieve__of__eratosthenes_8cpp_a235843bdf82d2a6cc8596ae8fd3b8df9_cgraph.svg index 01957319b..453aec1fd 100644 --- a/d8/ddf/sieve__of__eratosthenes_8cpp_a235843bdf82d2a6cc8596ae8fd3b8df9_cgraph.svg +++ b/d8/ddf/sieve__of__eratosthenes_8cpp_a235843bdf82d2a6cc8596ae8fd3b8df9_cgraph.svg @@ -36,7 +36,7 @@ Node3 - + is_prime diff --git a/d8/ddf/sieve__of__eratosthenes_8cpp_a7eebd5e7686a8db363f937b2f30d3818_cgraph.map b/d8/ddf/sieve__of__eratosthenes_8cpp_a7eebd5e7686a8db363f937b2f30d3818_cgraph.map index d5d33e1fd..c3b835521 100644 --- a/d8/ddf/sieve__of__eratosthenes_8cpp_a7eebd5e7686a8db363f937b2f30d3818_cgraph.map +++ b/d8/ddf/sieve__of__eratosthenes_8cpp_a7eebd5e7686a8db363f937b2f30d3818_cgraph.map @@ -1,4 +1,4 @@ - + diff --git a/d8/ddf/sieve__of__eratosthenes_8cpp_a7eebd5e7686a8db363f937b2f30d3818_cgraph.md5 b/d8/ddf/sieve__of__eratosthenes_8cpp_a7eebd5e7686a8db363f937b2f30d3818_cgraph.md5 index 41c0ce2c6..25ec456e6 100644 --- a/d8/ddf/sieve__of__eratosthenes_8cpp_a7eebd5e7686a8db363f937b2f30d3818_cgraph.md5 +++ b/d8/ddf/sieve__of__eratosthenes_8cpp_a7eebd5e7686a8db363f937b2f30d3818_cgraph.md5 @@ -1 +1 @@ -a01e272f9d9a830835656af2290340e0 \ No newline at end of file +8f650d7da6bb22ec080e6cbdafff830e \ No newline at end of file diff --git a/d8/ddf/sieve__of__eratosthenes_8cpp_a7eebd5e7686a8db363f937b2f30d3818_cgraph.svg b/d8/ddf/sieve__of__eratosthenes_8cpp_a7eebd5e7686a8db363f937b2f30d3818_cgraph.svg index abb0f16cd..b2e14cda1 100644 --- a/d8/ddf/sieve__of__eratosthenes_8cpp_a7eebd5e7686a8db363f937b2f30d3818_cgraph.svg +++ b/d8/ddf/sieve__of__eratosthenes_8cpp_a7eebd5e7686a8db363f937b2f30d3818_cgraph.svg @@ -21,7 +21,7 @@ Node2 - + is_prime diff --git a/d8/ddf/sieve__of__eratosthenes_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.map b/d8/ddf/sieve__of__eratosthenes_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.map index f94a74c31..ebb0d78f8 100644 --- a/d8/ddf/sieve__of__eratosthenes_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.map +++ b/d8/ddf/sieve__of__eratosthenes_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.map @@ -2,5 +2,5 @@ - + diff --git a/d8/ddf/sieve__of__eratosthenes_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.md5 b/d8/ddf/sieve__of__eratosthenes_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.md5 index f0b5a237f..4932ecb1b 100644 --- a/d8/ddf/sieve__of__eratosthenes_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.md5 +++ b/d8/ddf/sieve__of__eratosthenes_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.md5 @@ -1 +1 @@ -22f81b079611b763df85f7dde7633cdf \ No newline at end of file +297d7cc852761059172d520e88256c85 \ No newline at end of file diff --git a/d8/ddf/sieve__of__eratosthenes_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.svg b/d8/ddf/sieve__of__eratosthenes_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.svg index 65d75d076..9edcdf1c8 100644 --- a/d8/ddf/sieve__of__eratosthenes_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.svg +++ b/d8/ddf/sieve__of__eratosthenes_8cpp_a88ec9ad42717780d6caaff9d3d6977f9_cgraph.svg @@ -51,7 +51,7 @@ Node4 - + is_prime diff --git a/d8/ddf/sieve__of__eratosthenes_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d8/ddf/sieve__of__eratosthenes_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map index 06ab319fd..8193d3c70 100644 --- a/d8/ddf/sieve__of__eratosthenes_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map +++ b/d8/ddf/sieve__of__eratosthenes_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -1,6 +1,6 @@ - + diff --git a/d8/ddf/sieve__of__eratosthenes_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d8/ddf/sieve__of__eratosthenes_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 index 75d42cfc8..146a42c69 100644 --- a/d8/ddf/sieve__of__eratosthenes_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 +++ b/d8/ddf/sieve__of__eratosthenes_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -1 +1 @@ -1322414ac99b02b42ed9f079121b0540 \ No newline at end of file +38dcf03138371d66680d5ebf48bad9cb \ No newline at end of file diff --git a/d8/ddf/sieve__of__eratosthenes_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/d8/ddf/sieve__of__eratosthenes_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index e137d23dd..fdfb73f2c 100644 --- a/d8/ddf/sieve__of__eratosthenes_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/d8/ddf/sieve__of__eratosthenes_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -21,7 +21,7 @@ Node2 - + is_prime diff --git a/d9/df4/namespacetests_a2b9769e44683dcb67fe1083ad91e134d_cgraph.map b/d9/df4/namespacetests_a2b9769e44683dcb67fe1083ad91e134d_cgraph.map index eb240f5a2..11f6984ab 100644 --- a/d9/df4/namespacetests_a2b9769e44683dcb67fe1083ad91e134d_cgraph.map +++ b/d9/df4/namespacetests_a2b9769e44683dcb67fe1083ad91e134d_cgraph.map @@ -6,5 +6,5 @@ - + diff --git a/d9/df4/namespacetests_a2b9769e44683dcb67fe1083ad91e134d_cgraph.md5 b/d9/df4/namespacetests_a2b9769e44683dcb67fe1083ad91e134d_cgraph.md5 index 0049de821..fd0fd6e85 100644 --- a/d9/df4/namespacetests_a2b9769e44683dcb67fe1083ad91e134d_cgraph.md5 +++ b/d9/df4/namespacetests_a2b9769e44683dcb67fe1083ad91e134d_cgraph.md5 @@ -1 +1 @@ -c7dd5f787f6905f619ecb2f1305e0a0c \ No newline at end of file +dc5b2b161b4fb4ce25e1d47b6a5e80b4 \ No newline at end of file diff --git a/d9/df4/namespacetests_a2b9769e44683dcb67fe1083ad91e134d_cgraph.svg b/d9/df4/namespacetests_a2b9769e44683dcb67fe1083ad91e134d_cgraph.svg index d65a98bef..3afc8e7d0 100644 --- a/d9/df4/namespacetests_a2b9769e44683dcb67fe1083ad91e134d_cgraph.svg +++ b/d9/df4/namespacetests_a2b9769e44683dcb67fe1083ad91e134d_cgraph.svg @@ -112,7 +112,7 @@ Node8 - + is_prime diff --git a/d9/df4/namespacetests_aacafde185abd8670abee51157f273dc2_cgraph.map b/d9/df4/namespacetests_aacafde185abd8670abee51157f273dc2_cgraph.map index 4d79b71c5..0ed0d97a4 100644 --- a/d9/df4/namespacetests_aacafde185abd8670abee51157f273dc2_cgraph.map +++ b/d9/df4/namespacetests_aacafde185abd8670abee51157f273dc2_cgraph.map @@ -9,5 +9,5 @@ - + diff --git a/d9/df4/namespacetests_aacafde185abd8670abee51157f273dc2_cgraph.md5 b/d9/df4/namespacetests_aacafde185abd8670abee51157f273dc2_cgraph.md5 index 3dc77840f..561edac61 100644 --- a/d9/df4/namespacetests_aacafde185abd8670abee51157f273dc2_cgraph.md5 +++ b/d9/df4/namespacetests_aacafde185abd8670abee51157f273dc2_cgraph.md5 @@ -1 +1 @@ -fff1ea433f7e8b2767fbb6b885ebdd98 \ No newline at end of file +6e6b00aff1290eb8440957a48e1b1d3a \ No newline at end of file diff --git a/d9/df4/namespacetests_aacafde185abd8670abee51157f273dc2_cgraph.svg b/d9/df4/namespacetests_aacafde185abd8670abee51157f273dc2_cgraph.svg index 09b80c7e5..ed0521333 100644 --- a/d9/df4/namespacetests_aacafde185abd8670abee51157f273dc2_cgraph.svg +++ b/d9/df4/namespacetests_aacafde185abd8670abee51157f273dc2_cgraph.svg @@ -157,7 +157,7 @@ Node10 - + is_prime diff --git a/d9/df4/namespacetests_af7b81d7a1534216af6a36a80135beb86_cgraph.map b/d9/df4/namespacetests_af7b81d7a1534216af6a36a80135beb86_cgraph.map index fee527a81..dcc7d889e 100644 --- a/d9/df4/namespacetests_af7b81d7a1534216af6a36a80135beb86_cgraph.map +++ b/d9/df4/namespacetests_af7b81d7a1534216af6a36a80135beb86_cgraph.map @@ -6,5 +6,5 @@ - + diff --git a/d9/df4/namespacetests_af7b81d7a1534216af6a36a80135beb86_cgraph.md5 b/d9/df4/namespacetests_af7b81d7a1534216af6a36a80135beb86_cgraph.md5 index dcee7f5db..b7ce9259b 100644 --- a/d9/df4/namespacetests_af7b81d7a1534216af6a36a80135beb86_cgraph.md5 +++ b/d9/df4/namespacetests_af7b81d7a1534216af6a36a80135beb86_cgraph.md5 @@ -1 +1 @@ -89fa3e8dc2e843084451722be443a20b \ No newline at end of file +ad49d2bd2c8d03f3a65bb6297659de3f \ No newline at end of file diff --git a/d9/df4/namespacetests_af7b81d7a1534216af6a36a80135beb86_cgraph.svg b/d9/df4/namespacetests_af7b81d7a1534216af6a36a80135beb86_cgraph.svg index a61affdcf..a0dc51cd8 100644 --- a/d9/df4/namespacetests_af7b81d7a1534216af6a36a80135beb86_cgraph.svg +++ b/d9/df4/namespacetests_af7b81d7a1534216af6a36a80135beb86_cgraph.svg @@ -112,7 +112,7 @@ Node8 - + is_prime diff --git a/db/d93/check__prime_8cpp.html b/db/d93/check__prime_8cpp.html index eb4f1d115..c18d14f49 100644 --- a/db/d93/check__prime_8cpp.html +++ b/db/d93/check__prime_8cpp.html @@ -96,7 +96,7 @@ $(document).ready(function(){initNavTree('db/d93/check__prime_8cpp.html','../../
-

Reduced all possibilities of a number which cannot be prime. Eg: No even number, except 2 can be a prime number, hence we will increment our loop with i+2 jumping on all odd numbers only. If number is <= 1 or if it is even except 2, break the loop and return false telling number is not prime. +

Reduced all possibilities of a number which cannot be prime. Eg: No even number, except 2 can be a prime number, hence we will increment our loop with i+6 jumping and check for i or i+2 to be a factor of the number; if it's a factor then we will return false otherwise true after the loop terminates at the terminating condition which is (i*i<=num) More...

#include <cassert>
#include <iostream>
@@ -111,12 +111,13 @@ Include dependency graph for check_prime.cpp:
Functions template<typename T > bool is_prime (T num) + for IO operations More...
  int main ()  

Detailed Description

-

Reduced all possibilities of a number which cannot be prime. Eg: No even number, except 2 can be a prime number, hence we will increment our loop with i+2 jumping on all odd numbers only. If number is <= 1 or if it is even except 2, break the loop and return false telling number is not prime.

+

Reduced all possibilities of a number which cannot be prime. Eg: No even number, except 2 can be a prime number, hence we will increment our loop with i+6 jumping and check for i or i+2 to be a factor of the number; if it's a factor then we will return false otherwise true after the loop terminates at the terminating condition which is (i*i<=num)

Copyright 2020

Author
omkarlanghe

A simple program to check if the given number if prime or not.

Function Documentation

@@ -137,32 +138,34 @@ template<typename T >
-

Function to check if the given number is prime or not.

Parameters
+ +

for IO operations

+

for assert Function to check if the given number is prime or not.

Parameters
numnumber to be checked.
Returns
if number is prime, it returns @ true, else it returns @ false.
-
22 {
-
23 bool result = true;
-
24 if (num <= 1) {
-
25 return false;
-
26 } else if (num == 2) {
-
27 return true;
-
28 } else if ((num & 1) == 0) {
-
29 return false;
-
30 }
-
31 if (num >= 3) {
-
32 for (T i = 3; (i * i) <= (num); i = (i + 2)) {
-
33 if ((num % i) == 0) {
-
34 result = false;
-
35 break;
-
36 }
-
37 }
-
38 }
-
39 return (result);
-
40}
+
23 {
+
24 bool result = true;
+
25 if (num <= 1) {
+
26 return false;
+
27 } else if (num == 2 || num==3) {
+
28 return true;
+
29 } else if ((num%2) == 0 || num%3 == 0) {
+
30 return false;
+
31 }
+
32 else {
+
33 for (T i = 5; (i * i) <= (num); i = (i + 6)) {
+
34 if ((num % i) == 0 || (num%(i+2)==0 )) {
+
35 result = false;
+
36 break;
+
37 }
+
38 }
+
39 }
+
40 return (result);
+
41}
uint64_t result(uint64_t n)
Definition: fibonacci_sum.cpp:76
@@ -183,26 +186,26 @@ template<typename T >

Main function

-
45 {
-
46 // perform self-test
-
47 assert(is_prime(50) == false);
-
48 assert(is_prime(115249) == true);
-
49
-
50 int num = 0;
-
51 std::cout << "Enter the number to check if it is prime or not" << std::endl;
-
52 std::cin >> num;
-
53 bool result = is_prime(num);
-
54 if (result) {
-
55 std::cout << num << " is a prime number" << std::endl;
-
56 } else {
-
57 std::cout << num << " is not a prime number" << std::endl;
-
58 }
-
59
-
60 return 0;
-
61}
+
46 {
+
47 // perform self-test
+
48 assert(is_prime(50) == false);
+
49 assert(is_prime(115249) == true);
+
50
+
51 int num = 0;
+
52 std::cout << "Enter the number to check if it is prime or not" << std::endl;
+
53 std::cin >> num;
+
54 bool result = is_prime(num);
+
55 if (result) {
+
56 std::cout << num << " is a prime number" << std::endl;
+
57 } else {
+
58 std::cout << num << " is not a prime number" << std::endl;
+
59 }
+
60
+
61 return 0;
+
62}
-
bool is_prime(T num)
Definition: check_prime.cpp:22
+
bool is_prime(T num)
for IO operations
Definition: check_prime.cpp:23
T endl(T... args)
Here is the call graph for this function:
diff --git a/db/d93/check__prime_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/db/d93/check__prime_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map index e8ae9eabc..83efcd8a3 100644 --- a/db/d93/check__prime_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map +++ b/db/d93/check__prime_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map @@ -1,5 +1,5 @@ - + diff --git a/db/d93/check__prime_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/db/d93/check__prime_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 index bb28d9e7d..c2a6aa9cb 100644 --- a/db/d93/check__prime_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 +++ b/db/d93/check__prime_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 @@ -1 +1 @@ -db1b10fd19ccab62097e4c0ee967129c \ No newline at end of file +6ceb0935300be7e2bbb3ed1b2acfd585 \ No newline at end of file diff --git a/db/d93/check__prime_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/db/d93/check__prime_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg index f4e06b652..d2e27bc4b 100644 --- a/db/d93/check__prime_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ b/db/d93/check__prime_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg @@ -36,7 +36,7 @@ Node3 - + is_prime diff --git a/dir_296d53ceaeaa7e099814a6def439fe8a.html b/dir_296d53ceaeaa7e099814a6def439fe8a.html index 52ffb7de8..8ad80f0d0 100644 --- a/dir_296d53ceaeaa7e099814a6def439fe8a.html +++ b/dir_296d53ceaeaa7e099814a6def439fe8a.html @@ -112,7 +112,7 @@ Files  A simple program to check if the given number is a factorial of some number or not.
  file  check_prime.cpp - Reduced all possibilities of a number which cannot be prime. Eg: No even number, except 2 can be a prime number, hence we will increment our loop with i+2 jumping on all odd numbers only. If number is <= 1 or if it is even except 2, break the loop and return false telling number is not prime.
+ Reduced all possibilities of a number which cannot be prime. Eg: No even number, except 2 can be a prime number, hence we will increment our loop with i+6 jumping and check for i or i+2 to be a factor of the number; if it's a factor then we will return false otherwise true after the loop terminates at the terminating condition which is (i*i<=num)
  file  complex_numbers.cpp  An implementation of Complex Number as Objects.
diff --git a/files.html b/files.html index 239c58e9f..ea0359b52 100644 --- a/files.html +++ b/files.html @@ -204,7 +204,7 @@ solve-a-rat-in-a-maze-c-java-pytho/"  binomial_calculate.cppProgram to calculate Binomial coefficients  check_amicable_pair.cppA C++ Program to check whether a pair of number is amicable pair or not  check_factorial.cppA simple program to check if the given number is a factorial of some number or not - check_prime.cppReduced all possibilities of a number which cannot be prime. Eg: No even number, except 2 can be a prime number, hence we will increment our loop with i+2 jumping on all odd numbers only. If number is <= 1 or if it is even except 2, break the loop and return false telling number is not prime + check_prime.cppReduced all possibilities of a number which cannot be prime. Eg: No even number, except 2 can be a prime number, hence we will increment our loop with i+6 jumping and check for i or i+2 to be a factor of the number; if it's a factor then we will return false otherwise true after the loop terminates at the terminating condition which is (i*i<=num)  complex_numbers.cppAn implementation of Complex Number as Objects  double_factorial.cppCompute double factorial: \(n!!\)  eulers_totient_function.cppC++ Program to find Euler's Totient function