From 09db6cb5850aa34e0c11e57ad6a0d9c1bab1618a Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Sun, 17 Oct 2021 01:07:49 +0000 Subject: [PATCH] Documentation for 6272b2af084953471348442c79e19a6030c18427 --- d4/d48/hamming__distance_8cpp.html | 2 +- d7/d81/namespacebit__manipulation.html | 7 +- ...iling__ciphers__in__factorial__n_8cpp.html | 2 +- da/db8/count__of__set__bits_8cpp.html | 119 +++++++++--------- da/db8/count__of__set__bits_8cpp.js | 5 +- ...c98dc299e4db28b73e08309d977e62_cgraph.map} | 0 ...c98dc299e4db28b73e08309d977e62_cgraph.md5} | 0 ...c98dc299e4db28b73e08309d977e62_cgraph.svg} | 0 ...8dca7b867074164d5f45b0f3851269d_cgraph.map | 4 - ...8dca7b867074164d5f45b0f3851269d_cgraph.md5 | 1 - ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 37 ------ ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 5 - ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 - ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 52 -------- dd/d9f/count__of__set__bits_8cpp__incl.map | 3 +- dd/d9f/count__of__set__bits_8cpp__incl.md5 | 2 +- dd/d9f/count__of__set__bits_8cpp__incl.svg | 37 ++---- dir_f3c4fbc4e901afa0a54d0623c5574aa7.html | 2 +- files.html | 2 +- globals_func_t.html | 2 +- globals_t.html | 2 +- namespaces.html | 2 +- navtreedata.js | 4 +- navtreeindex0.js | 62 ++++----- navtreeindex1.js | 32 ++--- navtreeindex10.js | 28 ++--- navtreeindex11.js | 54 ++++---- navtreeindex12.js | 58 ++++----- navtreeindex13.js | 84 ++++++------- navtreeindex14.js | 35 +++--- navtreeindex2.js | 46 +++---- navtreeindex3.js | 54 ++++---- navtreeindex4.js | 68 +++++----- navtreeindex5.js | 58 ++++----- navtreeindex6.js | 50 ++++---- navtreeindex7.js | 52 ++++---- navtreeindex8.js | 38 +++--- navtreeindex9.js | 48 +++---- search/all_15.js | 6 +- search/all_4.js | 2 +- search/functions_14.js | 4 +- search/functions_3.js | 2 +- 42 files changed, 473 insertions(+), 599 deletions(-) rename da/db8/{count__of__set__bits_8cpp_a1f6a583b73a3e85c2d5121ed3d1c7d8a_cgraph.map => count__of__set__bits_8cpp_a86c98dc299e4db28b73e08309d977e62_cgraph.map} (100%) rename da/db8/{count__of__set__bits_8cpp_a1f6a583b73a3e85c2d5121ed3d1c7d8a_cgraph.md5 => count__of__set__bits_8cpp_a86c98dc299e4db28b73e08309d977e62_cgraph.md5} (100%) rename da/db8/{count__of__set__bits_8cpp_a1f6a583b73a3e85c2d5121ed3d1c7d8a_cgraph.svg => count__of__set__bits_8cpp_a86c98dc299e4db28b73e08309d977e62_cgraph.svg} (100%) delete mode 100644 da/db8/count__of__set__bits_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map delete mode 100644 da/db8/count__of__set__bits_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 delete mode 100644 da/db8/count__of__set__bits_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg delete mode 100644 da/db8/count__of__set__bits_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map delete mode 100644 da/db8/count__of__set__bits_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 delete mode 100644 da/db8/count__of__set__bits_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg diff --git a/d4/d48/hamming__distance_8cpp.html b/d4/d48/hamming__distance_8cpp.html index 61a18e690..5fb82335e 100644 --- a/d4/d48/hamming__distance_8cpp.html +++ b/d4/d48/hamming__distance_8cpp.html @@ -111,7 +111,7 @@ Include dependency graph for hamming_distance.cpp:

Namespaces

namespace  bit_manipulation - for std::vector
+ for IO operations
  namespace  hamming_distance  Functions for Hamming distance implementation.
diff --git a/d7/d81/namespacebit__manipulation.html b/d7/d81/namespacebit__manipulation.html index 36b0bbab8..b4c0e59da 100644 --- a/d7/d81/namespacebit__manipulation.html +++ b/d7/d81/namespacebit__manipulation.html @@ -94,14 +94,11 @@ $(document).ready(function(){initNavTree('d7/d81/namespacebit__manipulation.html
-

for std::vector +

for IO operations More...

Detailed Description

-

for std::vector

+

for IO operations

for io operations

-

for IO operations

-

for assert for io operations

-

Bit manipulation algorithms

for assert

Bit manipulation algorithms

for assert

diff --git a/da/d50/count__of__trailing__ciphers__in__factorial__n_8cpp.html b/da/d50/count__of__trailing__ciphers__in__factorial__n_8cpp.html index d17f14c22..888ebaca3 100644 --- a/da/d50/count__of__trailing__ciphers__in__factorial__n_8cpp.html +++ b/da/d50/count__of__trailing__ciphers__in__factorial__n_8cpp.html @@ -111,7 +111,7 @@ Include dependency graph for count_of_trailing_ciphers_in_factorial_n.cpp:

Namespaces

namespace  bit_manipulation - for std::vector
+ for IO operations
  namespace  count_of_trailing_ciphers_in_factorial_n  Functions for the Count the number of ciphers in n! implementation.
diff --git a/da/db8/count__of__set__bits_8cpp.html b/da/db8/count__of__set__bits_8cpp.html index 989c14979..cff479245 100644 --- a/da/db8/count__of__set__bits_8cpp.html +++ b/da/db8/count__of__set__bits_8cpp.html @@ -97,22 +97,21 @@ $(document).ready(function(){initNavTree('da/db8/count__of__set__bits_8cpp.html'
-

Implementation to count sets bits in an integer. +

Implementation to count number of set bits of a number in an integer. More...

#include <cassert>
#include <iostream>
-#include <vector>
Include dependency graph for count_of_set_bits.cpp:
-
+
- + @@ -120,23 +119,24 @@ Namespaces

Namespaces

namespace  bit_manipulation
 for std::vector
 for IO operations
 
namespace  count_of_set_bits
 Functions for the count sets bits implementation.
- - - + + + -

Functions

std::uint64_t bit_manipulation::count_of_set_bits::countSetBits (int n)
 The main function implements set bit count. More...
 
std::uint64_t bit_manipulation::count_of_set_bits::countSetBits (std ::int64_t n)
 The main function implements set bit count. More...
 
static void test ()
 Self-test implementations. More...
 
int main ()
 Main function. More...
 

Detailed Description

-

Implementation to count sets bits in an integer.

-

We are given an integer number. Let’s say, number. The task is to first calculate the binary digit of a number and then calculate the total set bits of a number.

-

Set bits in a binary number is represented by 1. Whenever we calculate the binary number of an integer value it is formed as the combination of 0’s and 1’s. So digit 1 is known as a set bit in computer terms. Time Complexity: O(log n) Space complexity: O(1)

Author
Swastika Gupta
+

Implementation to count number of set bits of a number in an integer.

+

We are given an integer number. We need to calculate the number of set bits in it.

+

A binary number consists of two digits. They are 0 & 1. Digit 1 is known as set bit in computer terms. Worst Case Time Complexity: O(log n) Space complexity: O(1)

Author
Swastika Gupta
+
+Prashant Thakur

Function Documentation

- -

◆ countSetBits()

+ +

◆ countSetBits()

@@ -144,7 +144,7 @@ Functions std::uint64_t bit_manipulation::count_of_set_bits::countSetBits ( - int  + std ::int64_t  n) @@ -158,20 +158,27 @@ Functions -
Returns
the count of the number set bit in the binary representation of n
-
41 {
-
42 int count = 0; // "count" variable is used to count number of 1's in binary
-
43 // representation of the number
-
44 while (n != 0) {
-
45 count += n & 1;
-
46 n = n >> 1; // n=n/2
-
47 }
-
48 return count;
-
49}
+
Returns
total number of set-bits in the binary representation of number n
+
36 { // int64_t is preferred over int so that
+
37 // no Overflow can be there.
+
38
+
39 int count = 0; // "count" variable is used to count number of set-bits('1') in
+
40 // binary representation of number 'n'
+
41 while (n != 0)
+
42 {
+
43 ++count;
+
44 n = (n & (n - 1));
+
45 }
+
46 return count;
+
47 // Why this algorithm is better than the standard one?
+
48 // Because this algorithm runs the same number of times as the number of
+
49 // set-bits in it. Means if my number is having "3" set bits, then this while loop
+
50 // will run only "3" times!!
+
51}
Here is the call graph for this function:
-
+
@@ -195,18 +202,11 @@ Here is the call graph for this function:

Main function.

Returns
0 on exit
-
77 {
-
78 test(); // run self-test implementations
-
79 return 0;
-
80}
-
static void test()
Self-test implementations.
Definition: count_of_set_bits.cpp:57
-
-Here is the call graph for this function:
-
-
-
-
- +
78 {
+
79 test(); // run self-test implementations
+
80 return 0;
+
81}
+
@@ -231,33 +231,28 @@ Here is the call graph for this function:
- -

Self-test implementations.

-
Returns
void
-
57 {
-
58 // n = 4 return 1
-
59 assert(bit_manipulation::count_of_set_bits::countSetBits(4) == 1);
-
60 // n = 6 return 2
-
61 assert(bit_manipulation::count_of_set_bits::countSetBits(6) == 2);
-
62 // n = 13 return 3
-
63 assert(bit_manipulation::count_of_set_bits::countSetBits(13) == 3);
-
64 // n = 9 return 2
-
65 assert(bit_manipulation::count_of_set_bits::countSetBits(9) == 2);
-
66 // n = 15 return 4
-
67 assert(bit_manipulation::count_of_set_bits::countSetBits(15) == 4);
-
68 // n = 25 return 3
-
69 assert(bit_manipulation::count_of_set_bits::countSetBits(25) == 3);
-
70 std::cout << "All test cases successfully passed!" << std::endl;
-
71}
+
55 {
+
56 // n = 4 return 1
+
57 assert(bit_manipulation::count_of_set_bits::countSetBits(4) == 1);
+
58 // n = 6 return 2
+
59 assert(bit_manipulation::count_of_set_bits::countSetBits(6) == 2);
+
60 // n = 13 return 3
+
61 assert(bit_manipulation::count_of_set_bits::countSetBits(13) == 3);
+
62 // n = 9 return 2
+
63 assert(bit_manipulation::count_of_set_bits::countSetBits(9) == 2);
+
64 // n = 15 return 4
+
65 assert(bit_manipulation::count_of_set_bits::countSetBits(15) == 4);
+
66 // n = 25 return 3
+
67 assert(bit_manipulation::count_of_set_bits::countSetBits(25) == 3);
+
68 // n = 97 return 3
+
69 assert(bit_manipulation::count_of_set_bits::countSetBits(97) == 3);
+
70 // n = 31 return 5
+
71 assert(bit_manipulation::count_of_set_bits::countSetBits(31) == 5);
+
72 std::cout << "All test cases successfully passed!" << std::endl;
+
73}
T endl(T... args)
-
-Here is the call graph for this function:
-
-
-
-
- +
diff --git a/da/db8/count__of__set__bits_8cpp.js b/da/db8/count__of__set__bits_8cpp.js index 34d90b721..8e2bf4c08 100644 --- a/da/db8/count__of__set__bits_8cpp.js +++ b/da/db8/count__of__set__bits_8cpp.js @@ -1,6 +1,5 @@ var count__of__set__bits_8cpp = [ - [ "countSetBits", "da/db8/count__of__set__bits_8cpp.html#a1f6a583b73a3e85c2d5121ed3d1c7d8a", null ], - [ "main", "da/db8/count__of__set__bits_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ], - [ "test", "da/db8/count__of__set__bits_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ] + [ "countSetBits", "da/db8/count__of__set__bits_8cpp.html#a86c98dc299e4db28b73e08309d977e62", null ], + [ "main", "da/db8/count__of__set__bits_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] ]; \ No newline at end of file diff --git a/da/db8/count__of__set__bits_8cpp_a1f6a583b73a3e85c2d5121ed3d1c7d8a_cgraph.map b/da/db8/count__of__set__bits_8cpp_a86c98dc299e4db28b73e08309d977e62_cgraph.map similarity index 100% rename from da/db8/count__of__set__bits_8cpp_a1f6a583b73a3e85c2d5121ed3d1c7d8a_cgraph.map rename to da/db8/count__of__set__bits_8cpp_a86c98dc299e4db28b73e08309d977e62_cgraph.map diff --git a/da/db8/count__of__set__bits_8cpp_a1f6a583b73a3e85c2d5121ed3d1c7d8a_cgraph.md5 b/da/db8/count__of__set__bits_8cpp_a86c98dc299e4db28b73e08309d977e62_cgraph.md5 similarity index 100% rename from da/db8/count__of__set__bits_8cpp_a1f6a583b73a3e85c2d5121ed3d1c7d8a_cgraph.md5 rename to da/db8/count__of__set__bits_8cpp_a86c98dc299e4db28b73e08309d977e62_cgraph.md5 diff --git a/da/db8/count__of__set__bits_8cpp_a1f6a583b73a3e85c2d5121ed3d1c7d8a_cgraph.svg b/da/db8/count__of__set__bits_8cpp_a86c98dc299e4db28b73e08309d977e62_cgraph.svg similarity index 100% rename from da/db8/count__of__set__bits_8cpp_a1f6a583b73a3e85c2d5121ed3d1c7d8a_cgraph.svg rename to da/db8/count__of__set__bits_8cpp_a86c98dc299e4db28b73e08309d977e62_cgraph.svg diff --git a/da/db8/count__of__set__bits_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map b/da/db8/count__of__set__bits_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map deleted file mode 100644 index 4aada47a7..000000000 --- a/da/db8/count__of__set__bits_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/da/db8/count__of__set__bits_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 b/da/db8/count__of__set__bits_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 deleted file mode 100644 index 8e6db7045..000000000 --- a/da/db8/count__of__set__bits_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 +++ /dev/null @@ -1 +0,0 @@ -e183666d54c346b35c418105d98411c7 \ No newline at end of file diff --git a/da/db8/count__of__set__bits_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg b/da/db8/count__of__set__bits_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg deleted file mode 100644 index 8e1110107..000000000 --- a/da/db8/count__of__set__bits_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - -test - - - -Node1 - - -test - - - - - -Node2 - - -std::endl - - - - - -Node1->Node2 - - - - - diff --git a/da/db8/count__of__set__bits_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/da/db8/count__of__set__bits_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map deleted file mode 100644 index ed79a0103..000000000 --- a/da/db8/count__of__set__bits_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/da/db8/count__of__set__bits_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/da/db8/count__of__set__bits_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 deleted file mode 100644 index c98e7529e..000000000 --- a/da/db8/count__of__set__bits_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 +++ /dev/null @@ -1 +0,0 @@ -d85680f165a4e2273155d939d5d88ca0 \ No newline at end of file diff --git a/da/db8/count__of__set__bits_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg b/da/db8/count__of__set__bits_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg deleted file mode 100644 index 615450e8f..000000000 --- a/da/db8/count__of__set__bits_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - -main - - - -Node1 - - -main - - - - - -Node2 - - -test - - - - - -Node1->Node2 - - - - - -Node3 - - -std::endl - - - - - -Node2->Node3 - - - - - diff --git a/dd/d9f/count__of__set__bits_8cpp__incl.map b/dd/d9f/count__of__set__bits_8cpp__incl.map index 56a2ca991..980a974bc 100644 --- a/dd/d9f/count__of__set__bits_8cpp__incl.map +++ b/dd/d9f/count__of__set__bits_8cpp__incl.map @@ -1,6 +1,5 @@ - + - diff --git a/dd/d9f/count__of__set__bits_8cpp__incl.md5 b/dd/d9f/count__of__set__bits_8cpp__incl.md5 index 633e112f2..035ab8238 100644 --- a/dd/d9f/count__of__set__bits_8cpp__incl.md5 +++ b/dd/d9f/count__of__set__bits_8cpp__incl.md5 @@ -1 +1 @@ -cd559673b3100180e77631b3f07f30e1 \ No newline at end of file +b401eec81c952a342b3c359bccc84789 \ No newline at end of file diff --git a/dd/d9f/count__of__set__bits_8cpp__incl.svg b/dd/d9f/count__of__set__bits_8cpp__incl.svg index b5c3183c7..a951dd499 100644 --- a/dd/d9f/count__of__set__bits_8cpp__incl.svg +++ b/dd/d9f/count__of__set__bits_8cpp__incl.svg @@ -4,18 +4,18 @@ - + bit_manipulation/count_of_set_bits.cpp - + Node1 - - -bit_manipulation/count -_of_set_bits.cpp + + +bit_manipulation/count +_of_set_bits.cpp @@ -31,8 +31,8 @@ Node1->Node2 - - + + @@ -46,23 +46,8 @@ Node1->Node3 - - - - - -Node4 - - -vector - - - - - -Node1->Node4 - - + + diff --git a/dir_f3c4fbc4e901afa0a54d0623c5574aa7.html b/dir_f3c4fbc4e901afa0a54d0623c5574aa7.html index 75067468d..71cb32335 100644 --- a/dir_f3c4fbc4e901afa0a54d0623c5574aa7.html +++ b/dir_f3c4fbc4e901afa0a54d0623c5574aa7.html @@ -97,7 +97,7 @@ $(document).ready(function(){initNavTree('dir_f3c4fbc4e901afa0a54d0623c5574aa7.h

Files

file  count_of_set_bits.cpp - Implementation to count sets bits in an integer.
+ Implementation to count number of set bits of a number in an integer.
  file  count_of_trailing_ciphers_in_factorial_n.cpp  Count the number of ciphers in n! implementation
diff --git a/files.html b/files.html index 75fa0fc7c..2fc28dd40 100644 --- a/files.html +++ b/files.html @@ -109,7 +109,7 @@ solve-a-rat-in-a-maze-c-java-pytho/"  sudoku_solve.cppSudoku Solver algorithm  wildcard_matching.cppImplementation of the Wildcard Matching problem   bit_manipulation - count_of_set_bits.cppImplementation to count sets bits in an integer + count_of_set_bits.cppImplementation to count number of set bits of a number in an integer  count_of_trailing_ciphers_in_factorial_n.cppCount the number of ciphers in n! implementation  hamming_distance.cppReturns the Hamming distance between two integers   ciphers diff --git a/globals_func_t.html b/globals_func_t.html index d354cf127..45bf3b4c3 100644 --- a/globals_func_t.html +++ b/globals_func_t.html @@ -94,7 +94,7 @@ $(document).ready(function(){initNavTree('globals_func_t.html',''); initResizabl

- t -