divide_and_conquer/karatsuba_algorithm_for_fast_multiplication.cpp
Node1
-
-divide_and_conquer
-/karatsuba_algorithm
-_for_fast_multiplication.cpp
+
+divide_and_conquer
+/karatsuba_algorithm
+_for_fast_multiplication.cpp
@@ -32,8 +32,8 @@
Node1->Node2
-
-
+
+
@@ -50,8 +50,8 @@
Node1->Node3
-
-
+
+
@@ -68,26 +68,8 @@
Node1->Node4
-
-
-
-
-
-
-
-Node5
-
-
-vector
-
-
-
-
-
-Node1->Node5
-
-
-
+
+
diff --git a/d0/d3e/classdata__structures_1_1trie.html b/d0/d3e/classdata__structures_1_1trie.html
index 60bc17da4..753afbe11 100644
--- a/d0/d3e/classdata__structures_1_1trie.html
+++ b/d0/d3e/classdata__structures_1_1trie.html
@@ -173,7 +173,7 @@ Static Private Attributes
Trie implementation for small-case English alphabets a-z
-
Definition at line 25 of file trie_tree.cpp.
+
Definition at line 24 of file trie_tree.cpp.
◆ char_to_int()
@@ -207,19 +207,19 @@ Static Private Attributes
- Returns
- unsigned integer index
-Definition at line 38 of file trie_tree.cpp.
- 38 {
-
39 if (ch >= 'A' && ch <= 'Z') {
-
40 return ch - 'A';
-
41 } else if (ch >= 'a' && ch <= 'z') {
-
-
43 }
-
44
-
45 std::cerr << "Invalid character present. Exiting...";
-
46 std::exit(EXIT_FAILURE);
-
47 return 0;
-
48 }
-
static constexpr uint8_t NUM_CHARS
Number of alphabets.
+
Definition at line 37 of file trie_tree.cpp.
+
37 {
+
38 if (ch >= 'A' && ch <= 'Z') {
+
39 return ch - 'A';
+
40 } else if (ch >= 'a' && ch <= 'z') {
+
+
42 }
+
43
+
44 std::cerr << "Invalid character present. Exiting...";
+
45 std::exit(EXIT_FAILURE);
+
46 return 0;
+
47 }
+
static constexpr uint8_t NUM_CHARS
Number of alphabets.
@@ -262,48 +262,48 @@ Static Private Attributes
false if unsuccessful
-Definition at line 134 of file trie_tree.cpp.
- 134 {
-
135 if (index == str.length()) {
-
-
137 return false;
-
138 }
-
-
140
-
141
-
142
-
143
-
144 return true;
-
145 }
-
-
-
148 return false;
-
149 }
-
-
151 if (var) {
-
-
-
154 return false;
-
155 } else {
-
156 int i = 0;
-
-
-
159 return false;
-
160 }
-
161 }
-
162 return true;
-
163 }
-
164 }
-
165
-
166
-
167 std::cout << __func__ << ":" << __LINE__
-
168 << "Should not reach this line\n";
-
169 return false;
-
170 }
-
std::array< std::shared_ptr< trie >, NUM_CHARS<< 1 > arr
Recursive tree nodes as an array of shared-pointers.
-
bool isEndofWord
identifier if a node is terminal node
-
uint8_t char_to_int(const char &ch) const
Convert a character to integer for indexing.
-
bool deleteString(const std::string &str, int index)
+
Definition at line 133 of file trie_tree.cpp.
+
133 {
+
134 if (index == str.length()) {
+
+
136 return false;
+
137 }
+
+
139
+
140
+
141
+
142
+
143 return true;
+
144 }
+
+
+
147 return false;
+
148 }
+
+
150 if (var) {
+
+
+
153 return false;
+
154 } else {
+
155 int i = 0;
+
+
+
158 return false;
+
159 }
+
160 }
+
161 return true;
+
162 }
+
163 }
+
164
+
165
+
166 std::cout << __func__ << ":" << __LINE__
+
167 << "Should not reach this line\n";
+
168 return false;
+
169 }
+
std::array< std::shared_ptr< trie >, NUM_CHARS<< 1 > arr
Recursive tree nodes as an array of shared-pointers.
+
bool isEndofWord
identifier if a node is terminal node
+
uint8_t char_to_int(const char &ch) const
Convert a character to integer for indexing.
+
bool deleteString(const std::string &str, int index)
@@ -336,30 +336,30 @@ Static Private Attributes
-Definition at line 77 of file trie_tree.cpp.
- 77 {
-
78 std::shared_ptr<trie> root(nullptr);
-
79
-
80 for (const char& ch : str) {
-
-
82 if (root) {
-
83 if (root->arr[j]) {
-
84 root = root->arr[j];
-
85 } else {
-
86 std::shared_ptr<trie> temp(
new trie());
-
87 root->arr[j] = temp;
-
88 root = temp;
-
89 }
-
-
-
92 } else {
-
93 std::shared_ptr<trie> temp(
new trie());
-
-
95 root = temp;
-
96 }
-
97 }
-
98 root->isEndofWord = true;
-
99 }
+
Definition at line 76 of file trie_tree.cpp.
+
76 {
+
77 std::shared_ptr<trie> root(nullptr);
+
78
+
79 for (const char& ch : str) {
+
+
81 if (root) {
+
82 if (root->arr[j]) {
+
83 root = root->arr[j];
+
84 } else {
+
85 std::shared_ptr<trie> temp(
new trie());
+
86 root->arr[j] = temp;
+
87 root = temp;
+
88 }
+
+
+
91 } else {
+
92 std::shared_ptr<trie> temp(
new trie());
+
+
94 root = temp;
+
95 }
+
96 }
+
97 root->isEndofWord = true;
+
98 }
trie()=default
Class default constructor.
@@ -406,21 +406,21 @@ Static Private Attributes
false if not found
-Definition at line 56 of file trie_tree.cpp.
- 57 {
-
58 if (index == str.length()) {
-
59 if (!root->isEndofWord) {
-
60 return false;
-
61 }
-
62 return true;
-
63 }
-
-
65 if (!root->arr[j]) {
-
66 return false;
-
67 }
-
68 return search(root->arr[j], str, index + 1);
-
69 }
-
bool search(const std::shared_ptr< trie > &root, const std::string &str, int index)
+
Definition at line 55 of file trie_tree.cpp.
+
56 {
+
57 if (index == str.length()) {
+
58 if (!root->isEndofWord) {
+
59 return false;
+
60 }
+
61 return true;
+
62 }
+
+
64 if (!root->arr[j]) {
+
65 return false;
+
66 }
+
67 return search(root->arr[j], str, index + 1);
+
68 }
+
bool search(const std::shared_ptr< trie > &root, const std::string &str, int index)
@@ -461,20 +461,20 @@ Static Private Attributes
false if not found
-Definition at line 107 of file trie_tree.cpp.
- 107 {
-
108 if (index == str.length()) {
-
-
110 return false;
-
111 }
-
112 return true;
-
113 }
-
-
-
116 return false;
-
117 }
-
-
119 }
+
Definition at line 106 of file trie_tree.cpp.
+
106 {
+
107 if (index == str.length()) {
+
+
109 return false;
+
110 }
+
111 return true;
+
112 }
+
+
+
115 return false;
+
116 }
+
+
118 }
@@ -501,7 +501,7 @@ Static Private Attributes
Recursive tree nodes as an array of shared-pointers.
-Definition at line 29 of file trie_tree.cpp.
+Definition at line 28 of file trie_tree.cpp.
@@ -527,7 +527,7 @@ Static Private Attributes
identifier if a node is terminal node
-Definition at line 30 of file trie_tree.cpp.
+Definition at line 29 of file trie_tree.cpp.
@@ -553,7 +553,7 @@ Static Private Attributes
Number of alphabets.
-Definition at line 27 of file trie_tree.cpp.
+Definition at line 26 of file trie_tree.cpp.
diff --git a/d0/dea/strassen__matrix__multiplication_8cpp_source.html b/d0/dea/strassen__matrix__multiplication_8cpp_source.html
index 7158121f8..cce8a84ac 100644
--- a/d0/dea/strassen__matrix__multiplication_8cpp_source.html
+++ b/d0/dea/strassen__matrix__multiplication_8cpp_source.html
@@ -516,7 +516,7 @@ $(function(){initNavTree('d0/dea/strassen__matrix__multiplication_8cpp_source.ht
static void test()
Self-test implementations.
static std::ostream & operator<<(std::ostream &out, matrix< T > const &v)
-
+
Namespace for performing strassen's multiplication.
diff --git a/d3/d40/graph__coloring_8cpp.html b/d3/d40/graph__coloring_8cpp.html
index 3f0bf519d..5da6532dd 100644
--- a/d3/d40/graph__coloring_8cpp.html
+++ b/d3/d40/graph__coloring_8cpp.html
@@ -132,11 +132,10 @@ $(function(){initNavTree('d3/d40/graph__coloring_8cpp.html','../../'); initResiz
More...
#include <array>
#include <iostream>
-#include <vector>
Go to the source code of this file.
@@ -225,30 +224,30 @@ template<size_t V>
-Definition at line 82 of file graph_coloring.cpp.
- 83 {
-
84
-
85
-
86 if (v == V) {
-
-
88 return;
-
89 }
-
90
-
91
-
92 for (int c = 1; c <= m; c++) {
-
93
-
94 if (isSafe<V>(v,
graph, color, c)) {
-
95 color[v] = c;
-
96
-
97
-
98 graphColoring<V>(
graph, m, color, v + 1);
-
99
-
100
-
101 color[v] = 0;
-
102 }
-
103 }
-
104}
-
void printSolution(const std::array< int, V > &color)
A utility function to print the solution.
+
Definition at line 81 of file graph_coloring.cpp.
+
82 {
+
83
+
84
+
85 if (v == V) {
+
+
87 return;
+
88 }
+
89
+
90
+
91 for (int c = 1; c <= m; c++) {
+
92
+
93 if (isSafe<V>(v,
graph, color, c)) {
+
94 color[v] = c;
+
95
+
96
+
97 graphColoring<V>(
graph, m, color, v + 1);
+
98
+
99
+
100 color[v] = 0;
+
101 }
+
102 }
+
103}
+
void printSolution(const std::array< int, V > &color)
A utility function to print the solution.
@@ -304,15 +303,15 @@ template<size_t V>
false if the color is not safe to be assigned to the node
-Definition at line 62 of file graph_coloring.cpp.
- 63 {
-
64 for (int i = 0; i < V; i++) {
-
65 if (
graph[v][i] && c == color[i]) {
-
66 return false;
-
67 }
-
68 }
-
69 return true;
-
70}
+
Definition at line 61 of file graph_coloring.cpp.
+
62 {
+
63 for (int i = 0; i < V; i++) {
+
64 if (
graph[v][i] && c == color[i]) {
+
65 return false;
+
66 }
+
67 }
+
68 return true;
+
69}
@@ -334,27 +333,27 @@ template<size_t V>
Main function.
- Returns
- 0 on exit
-Definition at line 112 of file graph_coloring.cpp.
- 112 {
-
113
-
114
-
115
-
116
-
117
-
118
-
119
-
120 const int V = 4;
-
121 std::array<std::array<int, V>, V>
graph = {
-
122 std::array<int, V>({0, 1, 1, 1}), std::array<int, V>({1, 0, 1, 0}),
-
123 std::array<int, V>({1, 1, 0, 1}), std::array<int, V>({1, 0, 1, 0})};
-
124
-
125 int m = 3;
-
126 std::array<int, V> color{};
-
127
-
-
129 return 0;
-
130}
-
void graphColoring(const std::array< std::array< int, V >, V > &graph, int m, std::array< int, V > color, int v)
Recursive utility function to solve m coloring problem.
+
Definition at line 111 of file graph_coloring.cpp.
+
111 {
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119 const int V = 4;
+
120 std::array<std::array<int, V>, V>
graph = {
+
121 std::array<int, V>({0, 1, 1, 1}), std::array<int, V>({1, 0, 1, 0}),
+
122 std::array<int, V>({1, 1, 0, 1}), std::array<int, V>({1, 0, 1, 0})};
+
123
+
124 int m = 3;
+
125 std::array<int, V> color{};
+
126
+
+
128 return 0;
+
129}
+
void graphColoring(const std::array< std::array< int, V >, V > &graph, int m, std::array< int, V > color, int v)
Recursive utility function to solve m coloring problem.
@@ -389,14 +388,14 @@ template<size_t V>
-Definition at line 42 of file graph_coloring.cpp.
- 42 {
-
43 std::cout << "Following are the assigned colors\n";
-
44 for (auto& col : color) {
-
45 std::cout << col;
-
46 }
-
47 std::cout << "\n";
-
48}
+
Definition at line 41 of file graph_coloring.cpp.
+
41 {
+
42 std::cout << "Following are the assigned colors\n";
+
43 for (auto& col : color) {
+
44 std::cout << col;
+
45 }
+
46 std::cout << "\n";
+
47}
diff --git a/d3/d40/graph__coloring_8cpp_source.html b/d3/d40/graph__coloring_8cpp_source.html
index f5d25f431..ffb7d053a 100644
--- a/d3/d40/graph__coloring_8cpp_source.html
+++ b/d3/d40/graph__coloring_8cpp_source.html
@@ -128,88 +128,87 @@ $(function(){initNavTree('d3/d40/graph__coloring_8cpp_source.html','../../'); in
-
-
-
-
-
-
-
-
43 std::cout <<
"Following are the assigned colors\n";
-
44 for (
auto& col : color) {
-
-
-
-
+
+
+
+
+
+
+
42 std::cout <<
"Following are the assigned colors\n";
+
43 for (
auto& col : color) {
+
+
+
+
-
-
-
-
62bool isSafe(
int v,
const std::array<std::array<int, V>, V>&
graph,
-
63 const std::array<int, V>& color,
int c) {
-
64 for (
int i = 0; i < V; i++) {
-
65 if (
graph[v][i] && c == color[i]) {
-
-
-
-
-
+
+
+
+
61bool isSafe(
int v,
const std::array<std::array<int, V>, V>&
graph,
+
62 const std::array<int, V>& color,
int c) {
+
63 for (
int i = 0; i < V; i++) {
+
64 if (
graph[v][i] && c == color[i]) {
+
+
+
+
+
-
-
-
-
-
83 std::array<int, V> color,
int v) {
-
-
-
-
-
-
-
-
-
92 for (
int c = 1; c <= m; c++) {
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
82 std::array<int, V> color,
int v) {
+
+
+
+
+
+
+
+
+
91 for (
int c = 1; c <= m; c++) {
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
121 std::array<std::array<int, V>, V>
graph = {
-
122 std::array<int, V>({0, 1, 1, 1}), std::array<int, V>({1, 0, 1, 0}),
-
123 std::array<int, V>({1, 1, 0, 1}), std::array<int, V>({1, 0, 1, 0})};
-
-
-
126 std::array<int, V> color{};
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
120 std::array<std::array<int, V>, V>
graph = {
+
121 std::array<int, V>({0, 1, 1, 1}), std::array<int, V>({1, 0, 1, 0}),
+
122 std::array<int, V>({1, 1, 0, 1}), std::array<int, V>({1, 0, 1, 0})};
+
+
+
125 std::array<int, V> color{};
+
+
+
+
-
void graphColoring(const std::array< std::array< int, V >, V > &graph, int m, std::array< int, V > color, int v)
Recursive utility function to solve m coloring problem.
-
void printSolution(const std::array< int, V > &color)
A utility function to print the solution.
-
bool isSafe(int v, const std::array< std::array< int, V >, V > &graph, const std::array< int, V > &color, int c)
Utility function to check if the current color assignment is safe for vertex v.
-
+
void graphColoring(const std::array< std::array< int, V >, V > &graph, int m, std::array< int, V > color, int v)
Recursive utility function to solve m coloring problem.
+
void printSolution(const std::array< int, V > &color)
A utility function to print the solution.
+
bool isSafe(int v, const std::array< std::array< int, V >, V > &graph, const std::array< int, V > &color, int c)
Utility function to check if the current color assignment is safe for vertex v.
+
Functions for the Graph Coloring algorithm,.
diff --git a/d6/dec/breadth__first__search_8cpp__incl.map b/d6/dec/breadth__first__search_8cpp__incl.map
index cb1159b75..6b17007a3 100644
--- a/d6/dec/breadth__first__search_8cpp__incl.map
+++ b/d6/dec/breadth__first__search_8cpp__incl.map
@@ -1,19 +1,17 @@
diff --git a/d6/dec/breadth__first__search_8cpp__incl.md5 b/d6/dec/breadth__first__search_8cpp__incl.md5
index 6df073f58..4e1b76d3f 100644
--- a/d6/dec/breadth__first__search_8cpp__incl.md5
+++ b/d6/dec/breadth__first__search_8cpp__incl.md5
@@ -1 +1 @@
-bdd0a49cd06946011c73edf0774d83de
\ No newline at end of file
+b6309b94241bfb1d9aa0df99347985bb
\ No newline at end of file
diff --git a/d6/dec/breadth__first__search_8cpp__incl.svg b/d6/dec/breadth__first__search_8cpp__incl.svg
index 63f89888c..ae1ed042b 100644
--- a/d6/dec/breadth__first__search_8cpp__incl.svg
+++ b/d6/dec/breadth__first__search_8cpp__incl.svg
@@ -4,8 +4,8 @@
-
Go to the source code of this file.
@@ -194,13 +193,13 @@ Functions
Main function.
- Returns
- 0 on exit
-
Definition at line 205 of file trie_tree.cpp.
-
205 {
-
-
207
-
208 return 0;
-
209}
-
static void test()
Testing function.
+
Definition at line 204 of file trie_tree.cpp.
+
204 {
+
+
206
+
207 return 0;
+
208}
+
static void test()
Testing function.
@@ -230,31 +229,31 @@ Functions
Testing function.
- Returns
- void
-
Definition at line 178 of file trie_tree.cpp.
-
178 {
-
-
-
181 root.insert("World");
-
182
-
183 assert(!root.search("hello", 0));
-
184 std::cout << "hello - " << root.search("hello", 0) << "\n";
-
185
-
186 assert(root.search("Hello", 0));
-
187 std::cout << "Hello - " << root.search("Hello", 0) << "\n";
-
188
-
189 assert(!root.search("Word", 0));
-
190 std::cout << "Word - " << root.search("Word", 0) << "\n";
-
191
-
192 assert(root.search("World", 0));
-
193 std::cout << "World - " << root.search("World", 0) << "\n";
-
194
-
195
-
196
-
197
-
198
-
199}
-
Trie implementation for small-case English alphabets a-z
-
void insert(const std::string &str)
+
Definition at line 177 of file trie_tree.cpp.
+
177 {
+
+
+
180 root.insert("World");
+
181
+
182 assert(!root.search("hello", 0));
+
183 std::cout << "hello - " << root.search("hello", 0) << "\n";
+
184
+
185 assert(root.search("Hello", 0));
+
186 std::cout << "Hello - " << root.search("Hello", 0) << "\n";
+
187
+
188 assert(!root.search("Word", 0));
+
189 std::cout << "Word - " << root.search("Word", 0) << "\n";
+
190
+
191 assert(root.search("World", 0));
+
192 std::cout << "World - " << root.search("World", 0) << "\n";
+
193
+
194
+
195
+
196
+
197
+
198}
+
Trie implementation for small-case English alphabets a-z
+
void insert(const std::string &str)
diff --git a/d7/d83/trie__tree_8cpp_source.html b/d7/d83/trie__tree_8cpp_source.html
index add8d4150..1d9349465 100644
--- a/d7/d83/trie__tree_8cpp_source.html
+++ b/d7/d83/trie__tree_8cpp_source.html
@@ -130,181 +130,180 @@ $(function(){initNavTree('d7/d83/trie__tree_8cpp_source.html','../../'); initRes
-
-
-
-
-
-
-
-
-
-
-
-
-
39 if (ch >=
'A' && ch <=
'Z') {
-
-
41 }
else if (ch >=
'a' && ch <=
'z') {
-
-
-
-
45 std::cerr <<
"Invalid character present. Exiting...";
-
46 std::exit(EXIT_FAILURE);
-
-
+
+
+
+
+
+
+
+
+
+
+
+
38 if (ch >=
'A' && ch <=
'Z') {
+
+
40 }
else if (ch >=
'a' && ch <=
'z') {
+
+
+
+
44 std::cerr <<
"Invalid character present. Exiting...";
+
45 std::exit(EXIT_FAILURE);
+
+
-
-
-
56 bool search(
const std::shared_ptr<trie>& root,
const std::string& str,
-
-
58 if (index == str.length()) {
-
59 if (!root->isEndofWord) {
-
-
-
-
-
-
-
-
-
68 return search(root->arr[j], str, index + 1);
-
+
+
+
55 bool search(
const std::shared_ptr<trie>& root,
const std::string& str,
+
+
57 if (index == str.length()) {
+
58 if (!root->isEndofWord) {
+
+
+
+
+
+
+
+
+
67 return search(root->arr[j], str, index + 1);
+
-
-
-
-
-
-
77 void insert(
const std::string& str) {
-
78 std::shared_ptr<trie> root(
nullptr);
-
-
80 for (
const char& ch : str) {
-
-
-
-
-
-
86 std::shared_ptr<trie> temp(
new trie());
-
-
-
-
-
-
-
93 std::shared_ptr<trie> temp(
new trie());
-
-
-
-
-
98 root->isEndofWord =
true;
-
+
+
+
+
+
+
76 void insert(
const std::string& str) {
+
77 std::shared_ptr<trie> root(
nullptr);
+
+
79 for (
const char& ch : str) {
+
+
+
+
+
+
85 std::shared_ptr<trie> temp(
new trie());
+
+
+
+
+
+
+
92 std::shared_ptr<trie> temp(
new trie());
+
+
+
+
+
97 root->isEndofWord =
true;
+
-
-
-
107 bool search(
const std::string& str,
int index) {
-
108 if (index == str.length()) {
-
-
-
-
-
-
-
-
-
-
-
+
+
+
106 bool search(
const std::string& str,
int index) {
+
107 if (index == str.length()) {
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
135 if (index == str.length()) {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
167 std::cout << __func__ <<
":" << __LINE__
-
168 <<
"Should not reach this line\n";
-
-
+
+
+
+
134 if (index == str.length()) {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
166 std::cout << __func__ <<
":" << __LINE__
+
167 <<
"Should not reach this line\n";
+
+
-
+
-
-
-
-
-
-
-
181 root.insert(
"World");
-
-
183 assert(!root.search(
"hello", 0));
-
184 std::cout <<
"hello - " << root.search(
"hello", 0) <<
"\n";
-
-
186 assert(root.search(
"Hello", 0));
-
187 std::cout <<
"Hello - " << root.search(
"Hello", 0) <<
"\n";
-
-
189 assert(!root.search(
"Word", 0));
-
190 std::cout <<
"Word - " << root.search(
"Word", 0) <<
"\n";
-
-
192 assert(root.search(
"World", 0));
-
193 std::cout <<
"World - " << root.search(
"World", 0) <<
"\n";
-
-
-
-
-
-
+
+
+
+
+
+
+
180 root.insert(
"World");
+
+
182 assert(!root.search(
"hello", 0));
+
183 std::cout <<
"hello - " << root.search(
"hello", 0) <<
"\n";
+
+
185 assert(root.search(
"Hello", 0));
+
186 std::cout <<
"Hello - " << root.search(
"Hello", 0) <<
"\n";
+
+
188 assert(!root.search(
"Word", 0));
+
189 std::cout <<
"Word - " << root.search(
"Word", 0) <<
"\n";
+
+
191 assert(root.search(
"World", 0));
+
192 std::cout <<
"World - " << root.search(
"World", 0) <<
"\n";
+
+
+
+
+
+
-
-
-
-
-
-
-
+
+
-
Trie implementation for small-case English alphabets a-z
-
void insert(const std::string &str)
-
std::array< std::shared_ptr< trie >, NUM_CHARS<< 1 > arr
Recursive tree nodes as an array of shared-pointers.
-
bool search(const std::string &str, int index)
-
static constexpr uint8_t NUM_CHARS
Number of alphabets.
-
bool isEndofWord
identifier if a node is terminal node
+
Trie implementation for small-case English alphabets a-z
+
void insert(const std::string &str)
+
std::array< std::shared_ptr< trie >, NUM_CHARS<< 1 > arr
Recursive tree nodes as an array of shared-pointers.
+
bool search(const std::string &str, int index)
+
static constexpr uint8_t NUM_CHARS
Number of alphabets.
+
bool isEndofWord
identifier if a node is terminal node
trie()=default
Class default constructor.
-
bool search(const std::shared_ptr< trie > &root, const std::string &str, int index)
-
uint8_t char_to_int(const char &ch) const
Convert a character to integer for indexing.
-
bool deleteString(const std::string &str, int index)
+
bool search(const std::shared_ptr< trie > &root, const std::string &str, int index)
+
uint8_t char_to_int(const char &ch) const
Convert a character to integer for indexing.
+
bool deleteString(const std::string &str, int index)
-
static void test()
Testing function.
-
+
static void test()
Testing function.
+
diff --git a/d7/dce/graph__coloring_8cpp__incl.map b/d7/dce/graph__coloring_8cpp__incl.map
index d679d068e..fd92f761d 100644
--- a/d7/dce/graph__coloring_8cpp__incl.map
+++ b/d7/dce/graph__coloring_8cpp__incl.map
@@ -1,9 +1,7 @@
diff --git a/d7/dce/graph__coloring_8cpp__incl.md5 b/d7/dce/graph__coloring_8cpp__incl.md5
index 02d2c76d7..859827923 100644
--- a/d7/dce/graph__coloring_8cpp__incl.md5
+++ b/d7/dce/graph__coloring_8cpp__incl.md5
@@ -1 +1 @@
-6b4447c47cb5fa9b64b269a138599c1e
\ No newline at end of file
+c54670a67c3cf0b4b7dd0f8523d86bcd
\ No newline at end of file
diff --git a/d7/dce/graph__coloring_8cpp__incl.svg b/d7/dce/graph__coloring_8cpp__incl.svg
index 2884cc759..78fc9d82f 100644
--- a/d7/dce/graph__coloring_8cpp__incl.svg
+++ b/d7/dce/graph__coloring_8cpp__incl.svg
@@ -4,8 +4,8 @@
-
+
@@ -23,9 +23,9 @@
Node1
-
-backtracking/graph
-_coloring.cpp
+
+backtracking/graph
+_coloring.cpp
@@ -42,8 +42,8 @@
Node1->Node2
-
-
+
+
@@ -60,26 +60,8 @@
Node1->Node3
-
-
-
-
-
-
-
-Node4
-
-
-vector
-
-
-
-
-
-Node1->Node4
-
-
-
+
+
diff --git a/d7/dce/graph__coloring_8cpp__incl_org.svg b/d7/dce/graph__coloring_8cpp__incl_org.svg
index 4e45987ea..b545c4655 100644
--- a/d7/dce/graph__coloring_8cpp__incl_org.svg
+++ b/d7/dce/graph__coloring_8cpp__incl_org.svg
@@ -4,17 +4,17 @@
-
+
backtracking/graph_coloring.cpp
Node1
-
-backtracking/graph
-_coloring.cpp
+
+backtracking/graph
+_coloring.cpp
@@ -31,8 +31,8 @@
Node1->Node2
-
-
+
+
@@ -49,26 +49,8 @@
Node1->Node3
-
-
-
-
-
-
-
-Node4
-
-
-vector
-
-
-
-
-
-Node1->Node4
-
-
-
+
+
diff --git a/da/dd3/karatsuba__algorithm__for__fast__multiplication_8cpp.html b/da/dd3/karatsuba__algorithm__for__fast__multiplication_8cpp.html
index d48601fa0..f4706df3f 100644
--- a/da/dd3/karatsuba__algorithm__for__fast__multiplication_8cpp.html
+++ b/da/dd3/karatsuba__algorithm__for__fast__multiplication_8cpp.html
@@ -133,11 +133,10 @@ $(function(){initNavTree('da/dd3/karatsuba__algorithm__for__fast__multiplication
#include <cassert>
#include <cstring>
#include <iostream>
-#include <vector>
Go to the source code of this file.
@@ -145,7 +144,7 @@ Include dependency graph for karatsuba_algorithm_for_fast_multiplication.cpp: |
| namespace | divide_and_conquer |
-| | for std::vector
|
+| | for IO operations
|
| |
| namespace | karatsuba_algorithm |
| | Functions for the Karatsuba algorithm for fast multiplication implementation.
|
@@ -206,46 +205,46 @@ Functions
- Returns
- the sum binary string
-Definition at line 37 of file karatsuba_algorithm_for_fast_multiplication.cpp.
- 37 {
-
38 std::string result;
-
39
-
40
-
41 int64_t len1 = first.size();
-
42 int64_t len2 = second.size();
-
43 std::string zero = "0";
-
44 if (len1 < len2) {
-
45 for (int64_t i = 0; i < len2 - len1; i++) {
-
46 zero += first;
-
47 first = zero;
-
48 zero = "0";
-
49 }
-
50 } else if (len1 > len2) {
-
51 for (int64_t i = 0; i < len1 - len2; i++) {
-
52 zero += second;
-
53 second = zero;
-
54 zero = "0";
-
55 }
-
56 }
-
57
-
58 int64_t length = std::max(len1, len2);
-
59 int64_t carry = 0;
-
60 for (int64_t i = length - 1; i >= 0; i--) {
-
61 int64_t firstBit = first.at(i) - '0';
-
62 int64_t secondBit = second.at(i) - '0';
-
63
-
64 int64_t
sum = (char(firstBit ^ secondBit ^ carry)) +
'0';
-
-
66
-
67 carry = char((firstBit & secondBit) | (secondBit & carry) |
-
68 (firstBit & carry));
-
69 }
-
70
-
71 if (carry) {
-
-
73 }
-
-
75}
+
Definition at line 36 of file karatsuba_algorithm_for_fast_multiplication.cpp.
+
36 {
+
37 std::string result;
+
38
+
39
+
40 int64_t len1 = first.size();
+
41 int64_t len2 = second.size();
+
42 std::string zero = "0";
+
43 if (len1 < len2) {
+
44 for (int64_t i = 0; i < len2 - len1; i++) {
+
45 zero += first;
+
46 first = zero;
+
47 zero = "0";
+
48 }
+
49 } else if (len1 > len2) {
+
50 for (int64_t i = 0; i < len1 - len2; i++) {
+
51 zero += second;
+
52 second = zero;
+
53 zero = "0";
+
54 }
+
55 }
+
56
+
57 int64_t length = std::max(len1, len2);
+
58 int64_t carry = 0;
+
59 for (int64_t i = length - 1; i >= 0; i--) {
+
60 int64_t firstBit = first.at(i) - '0';
+
61 int64_t secondBit = second.at(i) - '0';
+
62
+
63 int64_t
sum = (char(firstBit ^ secondBit ^ carry)) +
'0';
+
+
65
+
66 carry = char((firstBit & secondBit) | (secondBit & carry) |
+
67 (firstBit & carry));
+
68 }
+
69
+
70 if (carry) {
+
+
72 }
+
+
74}
uint64_t result(uint64_t n)
T sum(const std::vector< std::valarray< T > > &A)
@@ -280,41 +279,41 @@ Functions
- Returns
- the product number value
-
Definition at line 112 of file karatsuba_algorithm_for_fast_multiplication.cpp.
-
112 {
-
113 int64_t len1 = str1.size();
-
114 int64_t len2 = str2.size();
-
115 int64_t n = std::max(len1, len2);
-
116
-
117 if (n == 0) {
-
118 return 0;
-
119 }
-
120 if (n == 1) {
-
121 return (str1[0] - '0') * (str2[0] - '0');
-
122 }
-
123
-
124 int64_t fh = n / 2;
-
125 int64_t sh = n - fh;
-
126
-
-
-
129
-
-
-
132
-
133
-
-
-
-
-
-
139
-
140 return product1 * (1 << (2 * sh)) +
-
141 (product3 - product1 - product2) * (1 << sh) +
-
142 product2;
-
143}
-
std::string safe_substr(const std::string &str, int64_t x1, int64_t x2, int64_t n)
Wrapper function for substr that considers leading zeros.
-
std::string add_strings(std::string first, std::string second)
Binary addition.
+
Definition at line 111 of file karatsuba_algorithm_for_fast_multiplication.cpp.
+
111 {
+
112 int64_t len1 = str1.size();
+
113 int64_t len2 = str2.size();
+
114 int64_t n = std::max(len1, len2);
+
115
+
116 if (n == 0) {
+
117 return 0;
+
118 }
+
119 if (n == 1) {
+
120 return (str1[0] - '0') * (str2[0] - '0');
+
121 }
+
122
+
123 int64_t fh = n / 2;
+
124 int64_t sh = n - fh;
+
125
+
+
+
128
+
+
+
131
+
132
+
+
+
+
+
+
138
+
139 return product1 * (1 << (2 * sh)) +
+
140 (product3 - product1 - product2) * (1 << sh) +
+
141 product2;
+
142}
+
std::string safe_substr(const std::string &str, int64_t x1, int64_t x2, int64_t n)
Wrapper function for substr that considers leading zeros.
+
std::string add_strings(std::string first, std::string second)
Binary addition.
Functions for the Karatsuba algorithm for fast multiplication implementation.
@@ -337,12 +336,12 @@ Functions
Main function.
- Returns
- 0 on exit
-
Definition at line 181 of file karatsuba_algorithm_for_fast_multiplication.cpp.
-
@@ -389,25 +388,25 @@ Functions
"0" if substring spans to leading zeros only
-Definition at line 86 of file karatsuba_algorithm_for_fast_multiplication.cpp.
- 86 {
-
87 int64_t len = str.size();
-
88
-
89 if (len >= n) {
-
90 return str.substr(x1, x2);
-
91 }
-
92
-
93 int64_t y1 = x1 - (n - len);
-
94 int64_t y2 = (x1 + x2 - 1) - (n - len);
-
95
-
96 if (y2 < 0) {
-
97 return "0";
-
98 } else if (y1 < 0) {
-
99 return str.substr(0, y2 + 1);
-
100 } else {
-
101 return str.substr(y1, x2);
-
102 }
-
103}
+
Definition at line 85 of file karatsuba_algorithm_for_fast_multiplication.cpp.
+
85 {
+
86 int64_t len = str.size();
+
87
+
88 if (len >= n) {
+
89 return str.substr(x1, x2);
+
90 }
+
91
+
92 int64_t y1 = x1 - (n - len);
+
93 int64_t y2 = (x1 + x2 - 1) - (n - len);
+
94
+
95 if (y2 < 0) {
+
96 return "0";
+
97 } else if (y1 < 0) {
+
98 return str.substr(0, y2 + 1);
+
99 } else {
+
100 return str.substr(y1, x2);
+
101 }
+
102}
@@ -437,33 +436,33 @@ Functions
Self-test implementations.
- Returns
- void
-
Definition at line 151 of file karatsuba_algorithm_for_fast_multiplication.cpp.
-
151 {
-
152
-
153 std::string s11 = "1";
-
154 std::string s12 = "1010";
-
155 std::cout << "1st test... ";
-
-
157 s11, s12) == 10);
-
158 std::cout << "passed" << std::endl;
-
159
-
160
-
161 std::string s21 = "11";
-
162 std::string s22 = "1010";
-
163 std::cout << "2nd test... ";
-
-
165 s21, s22) == 30);
-
166 std::cout << "passed" << std::endl;
-
167
-
168
-
169 std::string s31 = "110";
-
170 std::string s32 = "1010";
-
171 std::cout << "3rd test... ";
-
-
173 s31, s32) == 60);
-
174 std::cout << "passed" << std::endl;
-
175}
-
int64_t karatsuba_algorithm(std::string str1, std::string str2)
The main function implements Karatsuba's algorithm for fast multiplication.
+
Definition at line 150 of file karatsuba_algorithm_for_fast_multiplication.cpp.
+
150 {
+
151
+
152 std::string s11 = "1";
+
153 std::string s12 = "1010";
+
154 std::cout << "1st test... ";
+
+
156 s11, s12) == 10);
+
157 std::cout << "passed" << std::endl;
+
158
+
159
+
160 std::string s21 = "11";
+
161 std::string s22 = "1010";
+
162 std::cout << "2nd test... ";
+
+
164 s21, s22) == 30);
+
165 std::cout << "passed" << std::endl;
+
166
+
167
+
168 std::string s31 = "110";
+
169 std::string s32 = "1010";
+
170 std::cout << "3rd test... ";
+
+
172 s31, s32) == 60);
+
173 std::cout << "passed" << std::endl;
+
174}
+
int64_t karatsuba_algorithm(std::string str1, std::string str2)
The main function implements Karatsuba's algorithm for fast multiplication.
diff --git a/da/dd3/karatsuba__algorithm__for__fast__multiplication_8cpp_source.html b/da/dd3/karatsuba__algorithm__for__fast__multiplication_8cpp_source.html
index b287991d4..c59bd6656 100644
--- a/da/dd3/karatsuba__algorithm__for__fast__multiplication_8cpp_source.html
+++ b/da/dd3/karatsuba__algorithm__for__fast__multiplication_8cpp_source.html
@@ -129,150 +129,149 @@ $(function(){initNavTree('da/dd3/karatsuba__algorithm__for__fast__multiplication
-
-
-
-
-
-
37std::string
add_strings(std::string first, std::string second) {
-
-
-
-
41 int64_t len1 = first.size();
-
42 int64_t len2 = second.size();
-
43 std::string zero =
"0";
-
-
45 for (int64_t i = 0; i < len2 - len1; i++) {
-
-
-
-
-
50 }
else if (len1 > len2) {
-
51 for (int64_t i = 0; i < len1 - len2; i++) {
-
-
-
-
-
-
-
58 int64_t length = std::max(len1, len2);
-
-
60 for (int64_t i = length - 1; i >= 0; i--) {
-
61 int64_t firstBit = first.at(i) -
'0';
-
62 int64_t secondBit = second.at(i) -
'0';
-
-
64 int64_t sum = (char(firstBit ^ secondBit ^ carry)) +
'0';
-
65 result.insert(result.begin(), sum);
-
-
67 carry = char((firstBit & secondBit) | (secondBit & carry) |
-
-
-
-
-
72 result.insert(result.begin(),
'1');
-
-
-
+
+
+
+
+
36std::string
add_strings(std::string first, std::string second) {
+
+
+
+
40 int64_t len1 = first.size();
+
41 int64_t len2 = second.size();
+
42 std::string zero =
"0";
+
+
44 for (int64_t i = 0; i < len2 - len1; i++) {
+
+
+
+
+
49 }
else if (len1 > len2) {
+
50 for (int64_t i = 0; i < len1 - len2; i++) {
+
+
+
+
+
+
+
57 int64_t length = std::max(len1, len2);
+
+
59 for (int64_t i = length - 1; i >= 0; i--) {
+
60 int64_t firstBit = first.at(i) -
'0';
+
61 int64_t secondBit = second.at(i) -
'0';
+
+
63 int64_t sum = (char(firstBit ^ secondBit ^ carry)) +
'0';
+
64 result.insert(result.begin(), sum);
+
+
66 carry = char((firstBit & secondBit) | (secondBit & carry) |
+
+
+
+
+
71 result.insert(result.begin(),
'1');
+
+
+
-
-
-
86std::string
safe_substr(
const std::string &str, int64_t x1, int64_t x2, int64_t n) {
-
87 int64_t len = str.size();
-
-
-
90 return str.substr(x1, x2);
-
-
-
93 int64_t y1 = x1 - (n - len);
-
94 int64_t y2 = (x1 + x2 - 1) - (n - len);
-
-
-
-
-
99 return str.substr(0, y2 + 1);
-
-
101 return str.substr(y1, x2);
-
-
+
+
+
85std::string
safe_substr(
const std::string &str, int64_t x1, int64_t x2, int64_t n) {
+
86 int64_t len = str.size();
+
+
+
89 return str.substr(x1, x2);
+
+
+
92 int64_t y1 = x1 - (n - len);
+
93 int64_t y2 = (x1 + x2 - 1) - (n - len);
+
+
+
+
+
98 return str.substr(0, y2 + 1);
+
+
100 return str.substr(y1, x2);
+
+
-
-
-
-
113 int64_t len1 = str1.size();
-
114 int64_t len2 = str2.size();
-
115 int64_t n = std::max(len1, len2);
-
-
-
-
-
-
121 return (str1[0] -
'0') * (str2[0] -
'0');
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
140 return product1 * (1 << (2 * sh)) +
-
141 (product3 - product1 - product2) * (1 << sh) +
-
-
+
+
+
+
112 int64_t len1 = str1.size();
+
113 int64_t len2 = str2.size();
+
114 int64_t n = std::max(len1, len2);
+
+
+
+
+
+
120 return (str1[0] -
'0') * (str2[0] -
'0');
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
139 return product1 * (1 << (2 * sh)) +
+
140 (product3 - product1 - product2) * (1 << sh) +
+
+
-
-
-
-
-
-
-
153 std::string s11 =
"1";
-
154 std::string s12 =
"1010";
-
155 std::cout <<
"1st test... ";
-
-
-
158 std::cout <<
"passed" << std::endl;
-
-
-
161 std::string s21 =
"11";
-
162 std::string s22 =
"1010";
-
163 std::cout <<
"2nd test... ";
-
-
-
166 std::cout <<
"passed" << std::endl;
-
-
-
169 std::string s31 =
"110";
-
170 std::string s32 =
"1010";
-
171 std::cout <<
"3rd test... ";
-
-
-
174 std::cout <<
"passed" << std::endl;
-
+
+
+
+
+
+
+
152 std::string s11 =
"1";
+
153 std::string s12 =
"1010";
+
154 std::cout <<
"1st test... ";
+
+
+
157 std::cout <<
"passed" << std::endl;
+
+
+
160 std::string s21 =
"11";
+
161 std::string s22 =
"1010";
+
162 std::cout <<
"2nd test... ";
+
+
+
165 std::cout <<
"passed" << std::endl;
+
+
+
168 std::string s31 =
"110";
+
169 std::string s32 =
"1010";
+
170 std::cout <<
"3rd test... ";
+
+
+
173 std::cout <<
"passed" << std::endl;
+
-
-
-
-
-
-
+
+
-
int64_t karatsuba_algorithm(std::string str1, std::string str2)
The main function implements Karatsuba's algorithm for fast multiplication.
-
static void test()
Self-test implementations.
-
std::string safe_substr(const std::string &str, int64_t x1, int64_t x2, int64_t n)
Wrapper function for substr that considers leading zeros.
-
std::string add_strings(std::string first, std::string second)
Binary addition.
-
-
+
int64_t karatsuba_algorithm(std::string str1, std::string str2)
The main function implements Karatsuba's algorithm for fast multiplication.
+
static void test()
Self-test implementations.
+
std::string safe_substr(const std::string &str, int64_t x1, int64_t x2, int64_t n)
Wrapper function for substr that considers leading zeros.
+
std::string add_strings(std::string first, std::string second)
Binary addition.
+
+
Functions for the Karatsuba algorithm for fast multiplication implementation.
diff --git a/db/dc0/namespacebacktracking.html b/db/dc0/namespacebacktracking.html
index 5e9f36575..a20edcd27 100644
--- a/db/dc0/namespacebacktracking.html
+++ b/db/dc0/namespacebacktracking.html
@@ -149,11 +149,8 @@ Functions
for assert
Backtracking algorithms.
for IO operations
-
for std::vector
for assert for I/O operation
Backtracking algorithms
-
for std::array for IO operations
-
Backtracking algorithms
for std::array
Backtracking algorithms
for std::count for assert for IO operations for std::list for std::accumulate for std::vector
diff --git a/dc/d61/classgraph_1_1_graph.html b/dc/d61/classgraph_1_1_graph.html
index de7ef95bf..416ba49b2 100644
--- a/dc/d61/classgraph_1_1_graph.html
+++ b/dc/d61/classgraph_1_1_graph.html
@@ -167,7 +167,7 @@ Private Attributes
template<typename T>
class graph::Graph< T >
Class for representing a graph as an adjacency list. Its vertices are indexed 0, 1, ..., N - 1.
-
Definition at line 64 of file breadth_first_search.cpp.
+
Definition at line 63 of file breadth_first_search.cpp.
◆ Graph()
@@ -215,7 +215,7 @@ template<typename T>
67 }
68 }
-
+
std::vector< std::vector< int > > neighbors
for each vertex it stores a list indicies of its neighbors
@@ -257,15 +257,15 @@ template<typename T>
add_edge(u,v,bidir) is used to add an edge between node u and node v by default , bidir is made true , i.e graph is bidirectional . It means if edge(u,v) is added then u-->v and v-->u both edges exist.
to make the graph unidirectional pass the third parameter of add_edge as false which will
-
Definition at line 74 of file breadth_first_search.cpp.
-
74 {
-
-
-
86
-
-
88 }
-
89 }
-
std::map< T, std::list< T > > adjacency_list
+
Definition at line 73 of file breadth_first_search.cpp.
+
73 {
+
+
+
85
+
+
87 }
+
88 }
+
std::map< T, std::list< T > > adjacency_list
@@ -305,32 +305,32 @@ template<typename T>
if the neighbour is unvisited , push it into the queue
mark the neighbour as visited
-Definition at line 96 of file breadth_first_search.cpp.
- 96 {
-
-
-
-
-
-
105 }
-
106 }
-
107
-
-
110
-
-
-
-
-
-
-
-
-
-
129 }
-
130 }
-
131 }
-
-
133 }
+
Definition at line 95 of file breadth_first_search.cpp.
+
95 {
+
+
+
+
+
+
104 }
+
105 }
+
106
+
+
109
+
+
+
+
+
+
+
+
+
+
128 }
+
129 }
+
130 }
+
+
132 }
@@ -389,7 +389,7 @@ template<typename T>
diff --git a/dd/dba/namespacedivide__and__conquer.html b/dd/dba/namespacedivide__and__conquer.html
index 94493c948..5415b35ea 100644
--- a/dd/dba/namespacedivide__and__conquer.html
+++ b/dd/dba/namespacedivide__and__conquer.html
@@ -125,12 +125,12 @@ $(function(){initNavTree('dd/dba/namespacedivide__and__conquer.html','../../');
-
for std::vector
+
for IO operations
More...
-
for std::vector
+
for IO operations
Strassen's algorithm is one of the methods for multiplying two matrices. It is one of the faster algorithms for larger matrices than naive multiplication method.
-
for assert for string for IO operations
+
for assert for string
Divide and Conquer algorithms
It involves dividing each matrices into 4 blocks, given they are evenly divisible, and are combined with new defined matrices involving 7 matrix multiplications instead of eight, yielding O(n^2.8073) complexity.
- Author
- AshishYUO For assert operation For std::chrono; time measurement For I/O operations For std::tuple For creating dynamic arrays
diff --git a/de/d99/trie__tree_8cpp__incl.map b/de/d99/trie__tree_8cpp__incl.map
index b23c10442..8c05e991a 100644
--- a/de/d99/trie__tree_8cpp__incl.map
+++ b/de/d99/trie__tree_8cpp__incl.map
@@ -1,15 +1,13 @@
diff --git a/de/d99/trie__tree_8cpp__incl.md5 b/de/d99/trie__tree_8cpp__incl.md5
index 62c1997c4..9d58e1060 100644
--- a/de/d99/trie__tree_8cpp__incl.md5
+++ b/de/d99/trie__tree_8cpp__incl.md5
@@ -1 +1 @@
-1cf5791bbfd7e15df47212f7724835dd
\ No newline at end of file
+25563c9822626b8e6bcc2e85f96288f5
\ No newline at end of file
diff --git a/de/d99/trie__tree_8cpp__incl.svg b/de/d99/trie__tree_8cpp__incl.svg
index 9d0377c5e..4b9f0bc82 100644
--- a/de/d99/trie__tree_8cpp__incl.svg
+++ b/de/d99/trie__tree_8cpp__incl.svg
@@ -4,8 +4,8 @@
-
+
@@ -23,9 +23,9 @@
Node1
-
-data_structures/trie
-_tree.cpp
+
+data_structures/trie
+_tree.cpp
@@ -42,8 +42,8 @@
Node1->Node2
-
-
+
+
@@ -60,8 +60,8 @@
Node1->Node3
-
-
+
+
@@ -78,8 +78,8 @@
Node1->Node4
-
-
+
+
@@ -96,8 +96,8 @@
Node1->Node5
-
-
+
+
@@ -114,26 +114,8 @@
Node1->Node6
-
-
-
-
-
-
-
-Node7
-
-
-vector
-
-
-
-
-
-Node1->Node7
-
-
-
+
+
diff --git a/de/d99/trie__tree_8cpp__incl_org.svg b/de/d99/trie__tree_8cpp__incl_org.svg
index 372845421..4ba7b9697 100644
--- a/de/d99/trie__tree_8cpp__incl_org.svg
+++ b/de/d99/trie__tree_8cpp__incl_org.svg
@@ -4,17 +4,17 @@
-
+
data_structures/trie_tree.cpp
Node1
-
-data_structures/trie
-_tree.cpp
+
+data_structures/trie
+_tree.cpp
@@ -31,8 +31,8 @@
Node1->Node2
-
-
+
+
@@ -49,8 +49,8 @@
Node1->Node3
-
-
+
+
@@ -67,8 +67,8 @@
Node1->Node4
-
-
+
+
@@ -85,8 +85,8 @@
Node1->Node5
-
-
+
+
@@ -103,26 +103,8 @@
Node1->Node6
-
-
-
-
-
-
-
-Node7
-
-
-vector
-
-
-
-
-
-Node1->Node7
-
-
-
+
+
diff --git a/de/dde/lowest__common__ancestor_8cpp_source.html b/de/dde/lowest__common__ancestor_8cpp_source.html
index 9633270c7..8d67aef49 100644
--- a/de/dde/lowest__common__ancestor_8cpp_source.html
+++ b/de/dde/lowest__common__ancestor_8cpp_source.html
@@ -283,7 +283,7 @@ $(function(){initNavTree('de/dde/lowest__common__ancestor_8cpp_source.html','../
-
+
std::vector< std::vector< int > > neighbors
for each vertex it stores a list indicies of its neighbors
Graph(size_t N, const std::vector< std::pair< int, int > > &undirected_edges)
Populate the adjacency list for each vertex in the graph. Assumes that evey edge is a pair of valid v...
int number_of_vertices() const
diff --git a/df/d82/breadth__first__search_8cpp.html b/df/d82/breadth__first__search_8cpp.html
index 84b49c484..07377f109 100644
--- a/df/d82/breadth__first__search_8cpp.html
+++ b/df/d82/breadth__first__search_8cpp.html
@@ -138,11 +138,10 @@ $(function(){initNavTree('df/d82/breadth__first__search_8cpp.html','../../'); in
#include <map>
#include <queue>
#include <string>
-
#include <vector>
Go to the source code of this file.
@@ -209,28 +208,28 @@ Functions
Main function
-
Definition at line 186 of file breadth_first_search.cpp.
-
186 {
-
-
188 size_t edges = 0;
-
189 std::cout << "Enter the number of edges: ";
-
190 std::cin >> edges;
-
191
-
-
193
-
194 std::cout << "Enter space-separated pairs of vertices that form edges: "
-
195 << std::endl;
-
196 while (edges--) {
-
197 int u = 0, v = 0;
-
198 std::cin >> u >> v;
-
-
200 }
-
201
-
202 g.breadth_first_search(0);
-
203 return 0;
-
204}
-
-
+
Definition at line 185 of file breadth_first_search.cpp.
+
185 {
+
+
187 size_t edges = 0;
+
188 std::cout << "Enter the number of edges: ";
+
189 std::cin >> edges;
+
190
+
+
192
+
193 std::cout << "Enter space-separated pairs of vertices that form edges: "
+
194 << std::endl;
+
195 while (edges--) {
+
196 int u = 0, v = 0;
+
197 std::cin >> u >> v;
+
+
199 }
+
200
+
201 g.breadth_first_search(0);
+
202 return 0;
+
203}
+
+
double g(double x)
Another test function.
@@ -262,51 +261,51 @@ Functions
Test 2 Begin
Test 3 Begins
-
Definition at line 139 of file breadth_first_search.cpp.
-
139 {
-
-
142 std::map<int, bool> correct_result;
-
-
-
-
146 correct_result[0] = true;
-
147 correct_result[1] = true;
-
148 correct_result[2] = true;
-
149 correct_result[3] = true;
-
150
-
151 std::map<int, bool> returned_result =
g.breadth_first_search(2);
-
152
-
153 assert(returned_result == correct_result);
-
154 std::cout << "Test 1 Passed..." << std::endl;
-
155
-
157 returned_result =
g.breadth_first_search(0);
-
158
-
159 assert(returned_result == correct_result);
-
160 std::cout << "Test 2 Passed..." << std::endl;
-
161
-
-
164
-
165 g2.
add_edge(
"Gorakhpur",
"Lucknow",
false);
-
166 g2.
add_edge(
"Gorakhpur",
"Kanpur",
false);
-
167 g2.
add_edge(
"Lucknow",
"Agra",
false);
-
168 g2.
add_edge(
"Kanpur",
"Agra",
false);
-
169 g2.
add_edge(
"Lucknow",
"Prayagraj",
false);
-
170 g2.
add_edge(
"Agra",
"Noida",
false);
-
171
-
172 std::map<std::string, bool> correct_res;
-
173 std::map<std::string, bool> returned_res =
-
-
175 correct_res["Gorakhpur"] = false;
-
176 correct_res["Lucknow"] = false;
-
177 correct_res["Kanpur"] = true;
-
178 correct_res["Agra"] = true;
-
179 correct_res["Prayagraj"] = false;
-
180 correct_res["Noida"] = true;
-
181 assert(correct_res == returned_res);
-
182 std::cout << "Test 3 Passed..." << std::endl;
-
183}
-
std::map< T, bool > breadth_first_search(T src)
-
void add_edge(T u, T v, bool bidir=true)
+
Definition at line 138 of file breadth_first_search.cpp.
+
138 {
+
+
141 std::map<int, bool> correct_result;
+
+
+
+
145 correct_result[0] = true;
+
146 correct_result[1] = true;
+
147 correct_result[2] = true;
+
148 correct_result[3] = true;
+
149
+
150 std::map<int, bool> returned_result =
g.breadth_first_search(2);
+
151
+
152 assert(returned_result == correct_result);
+
153 std::cout << "Test 1 Passed..." << std::endl;
+
154
+
156 returned_result =
g.breadth_first_search(0);
+
157
+
158 assert(returned_result == correct_result);
+
159 std::cout << "Test 2 Passed..." << std::endl;
+
160
+
+
163
+
164 g2.
add_edge(
"Gorakhpur",
"Lucknow",
false);
+
165 g2.
add_edge(
"Gorakhpur",
"Kanpur",
false);
+
166 g2.
add_edge(
"Lucknow",
"Agra",
false);
+
167 g2.
add_edge(
"Kanpur",
"Agra",
false);
+
168 g2.
add_edge(
"Lucknow",
"Prayagraj",
false);
+
169 g2.
add_edge(
"Agra",
"Noida",
false);
+
170
+
171 std::map<std::string, bool> correct_res;
+
172 std::map<std::string, bool> returned_res =
+
+
174 correct_res["Gorakhpur"] = false;
+
175 correct_res["Lucknow"] = false;
+
176 correct_res["Kanpur"] = true;
+
177 correct_res["Agra"] = true;
+
178 correct_res["Prayagraj"] = false;
+
179 correct_res["Noida"] = true;
+
180 assert(correct_res == returned_res);
+
181 std::cout << "Test 3 Passed..." << std::endl;
+
182}
+
std::map< T, bool > breadth_first_search(T src)
+
void add_edge(T u, T v, bool bidir=true)
diff --git a/df/d82/breadth__first__search_8cpp_source.html b/df/d82/breadth__first__search_8cpp_source.html
index 8ddcb928f..c89e7def3 100644
--- a/df/d82/breadth__first__search_8cpp_source.html
+++ b/df/d82/breadth__first__search_8cpp_source.html
@@ -132,132 +132,131 @@ $(function(){initNavTree('df/d82/breadth__first__search_8cpp_source.html','../..
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
98 std::map<T, bool> visited;
-
-
102 visited[adjlist.first] =
false;
-
-
104 visited[
node] =
false;
-
-
-
-
109 std::queue<T> tracker;
-
-
-
-
115 while (!tracker.empty()) {
-
118 T
node = tracker.front();
-
-
-
124 if (!visited[neighbour]) {
-
126 tracker.push(neighbour);
-
128 visited[neighbour] =
true;
-
-
-
-
-
+
+
+
+
97 std::map<T, bool> visited;
+
+
101 visited[adjlist.first] =
false;
+
+
103 visited[
node] =
false;
+
+
+
+
108 std::queue<T> tracker;
+
+
+
+
114 while (!tracker.empty()) {
+
117 T
node = tracker.front();
+
+
+
123 if (!visited[neighbour]) {
+
125 tracker.push(neighbour);
+
127 visited[neighbour] =
true;
+
+
+
+
+
-
+
-
-
-
-
-
-
-
142 std::map<int, bool> correct_result;
-
-
-
-
146 correct_result[0] =
true;
-
147 correct_result[1] =
true;
-
148 correct_result[2] =
true;
-
149 correct_result[3] =
true;
-
-
151 std::map<int, bool> returned_result = g.breadth_first_search(2);
-
-
153 assert(returned_result == correct_result);
-
154 std::cout <<
"Test 1 Passed..." << std::endl;
-
-
157 returned_result = g.breadth_first_search(0);
-
-
159 assert(returned_result == correct_result);
-
160 std::cout <<
"Test 2 Passed..." << std::endl;
-
-
-
-
165 g2.
add_edge(
"Gorakhpur",
"Lucknow",
false);
-
166 g2.
add_edge(
"Gorakhpur",
"Kanpur",
false);
-
167 g2.
add_edge(
"Lucknow",
"Agra",
false);
-
168 g2.
add_edge(
"Kanpur",
"Agra",
false);
-
169 g2.
add_edge(
"Lucknow",
"Prayagraj",
false);
-
170 g2.
add_edge(
"Agra",
"Noida",
false);
-
-
172 std::map<std::string, bool> correct_res;
-
173 std::map<std::string, bool> returned_res =
-
-
175 correct_res[
"Gorakhpur"] =
false;
-
176 correct_res[
"Lucknow"] =
false;
-
177 correct_res[
"Kanpur"] =
true;
-
178 correct_res[
"Agra"] =
true;
-
179 correct_res[
"Prayagraj"] =
false;
-
180 correct_res[
"Noida"] =
true;
-
181 assert(correct_res == returned_res);
-
182 std::cout <<
"Test 3 Passed..." << std::endl;
-
+
+
+
+
+
+
+
141 std::map<int, bool> correct_result;
+
+
+
+
145 correct_result[0] =
true;
+
146 correct_result[1] =
true;
+
147 correct_result[2] =
true;
+
148 correct_result[3] =
true;
+
+
150 std::map<int, bool> returned_result = g.breadth_first_search(2);
+
+
152 assert(returned_result == correct_result);
+
153 std::cout <<
"Test 1 Passed..." << std::endl;
+
+
156 returned_result = g.breadth_first_search(0);
+
+
158 assert(returned_result == correct_result);
+
159 std::cout <<
"Test 2 Passed..." << std::endl;
+
+
+
+
164 g2.
add_edge(
"Gorakhpur",
"Lucknow",
false);
+
165 g2.
add_edge(
"Gorakhpur",
"Kanpur",
false);
+
166 g2.
add_edge(
"Lucknow",
"Agra",
false);
+
167 g2.
add_edge(
"Kanpur",
"Agra",
false);
+
168 g2.
add_edge(
"Lucknow",
"Prayagraj",
false);
+
169 g2.
add_edge(
"Agra",
"Noida",
false);
+
+
171 std::map<std::string, bool> correct_res;
+
172 std::map<std::string, bool> returned_res =
+
+
174 correct_res[
"Gorakhpur"] =
false;
+
175 correct_res[
"Lucknow"] =
false;
+
176 correct_res[
"Kanpur"] =
true;
+
177 correct_res[
"Agra"] =
true;
+
178 correct_res[
"Prayagraj"] =
false;
+
179 correct_res[
"Noida"] =
true;
+
180 assert(correct_res == returned_res);
+
181 std::cout <<
"Test 3 Passed..." << std::endl;
+
-
-
-
-
-
-
189 std::cout <<
"Enter the number of edges: ";
-
-
-
-
-
194 std::cout <<
"Enter space-separated pairs of vertices that form edges: "
-
-
-
-
-
-
-
-
202 g.breadth_first_search(0);
-
-
+
+
+
+
+
+
188 std::cout <<
"Enter the number of edges: ";
+
+
+
+
+
193 std::cout <<
"Enter space-separated pairs of vertices that form edges: "
+
+
+
+
+
+
+
+
201 g.breadth_first_search(0);
+
+
-
-
-
-
std::map< T, bool > breadth_first_search(T src)
-
void add_edge(T u, T v, bool bidir=true)
-
std::map< T, std::list< T > > adjacency_list
+
+
+
+
std::map< T, bool > breadth_first_search(T src)
+
void add_edge(T u, T v, bool bidir=true)
+
std::map< T, std::list< T > > adjacency_list
diff --git a/namespaces.html b/namespaces.html
index e72b1f285..bbffb5056 100644
--- a/namespaces.html
+++ b/namespaces.html
@@ -152,7 +152,7 @@ $(function(){initNavTree('namespaces.html',''); initResizable(true); });
| Ntreap | Functions for the Treap algorithm implementation |
| Ndepth_first_search | Functions for Depth First Search algorithm |
| Ndisjoint_union | Functions for Disjoint union implementation |
-
| Ndivide_and_conquer | For std::vector |
+
| Ndivide_and_conquer | For IO operations |
| Ndnf_sort | Functions for the DNF sort implementation |
| Ndouble_hashing | An implementation of hash table using double hashing algorithm |
| Ndp | For std::vector |