diff --git a/d1/dd7/union__of__two__arrays_8cpp__incl.map b/d1/dd7/union__of__two__arrays_8cpp__incl.map
new file mode 100644
index 000000000..4c7099a03
--- /dev/null
+++ b/d1/dd7/union__of__two__arrays_8cpp__incl.map
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/d1/dd7/union__of__two__arrays_8cpp__incl.md5 b/d1/dd7/union__of__two__arrays_8cpp__incl.md5
new file mode 100644
index 000000000..dfc27b398
--- /dev/null
+++ b/d1/dd7/union__of__two__arrays_8cpp__incl.md5
@@ -0,0 +1 @@
+52a6e80058339e8c1ccdf2935ebaf292
\ No newline at end of file
diff --git a/d1/dd7/union__of__two__arrays_8cpp__incl.svg b/d1/dd7/union__of__two__arrays_8cpp__incl.svg
new file mode 100644
index 000000000..c14d8af53
--- /dev/null
+++ b/d1/dd7/union__of__two__arrays_8cpp__incl.svg
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+operations_on_datastructures/union_of_two_arrays.cpp
+
+
+
+Node1
+
+
+operations_on_datastructures
+/union_of_two_arrays.cpp
+
+
+
+
+
+Node2
+
+
+algorithm
+
+
+
+
+
+Node1->Node2
+
+
+
+
+
+Node3
+
+
+cassert
+
+
+
+
+
+Node1->Node3
+
+
+
+
+
+Node4
+
+
+iostream
+
+
+
+
+
+Node1->Node4
+
+
+
+
+
+Node5
+
+
+vector
+
+
+
+
+
+Node1->Node5
+
+
+
+
+
diff --git a/d5/d88/md__d_i_r_e_c_t_o_r_y.html b/d5/d88/md__d_i_r_e_c_t_o_r_y.html
index a5db82e7a..72d4366e4 100644
--- a/d5/d88/md__d_i_r_e_c_t_o_r_y.html
+++ b/d5/d88/md__d_i_r_e_c_t_o_r_y.html
@@ -373,7 +373,7 @@ Operations On Datastructures
Reverse Binary Tree
Selectionsortlinkedlist
Trie Multiple Search
-Union Of 2 Arrays
+Union Of Two Arrays
Others
diff --git a/d8/d9c/union__of__two__arrays_8cpp.html b/d8/d9c/union__of__two__arrays_8cpp.html
new file mode 100644
index 000000000..aa094febe
--- /dev/null
+++ b/d8/d9c/union__of__two__arrays_8cpp.html
@@ -0,0 +1,249 @@
+
+
+
+
+
+
+
+Algorithms_in_C++: operations_on_datastructures/union_of_two_arrays.cpp File Reference
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Algorithms_in_C++ 1.0.0
+
+ Set of algorithms implemented in C++.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Implementation for the Union of two sorted Arrays algorithm.
+More...
+
#include <algorithm>
+#include <cassert>
+#include <iostream>
+#include <vector>
+
+
+
Implementation for the Union of two sorted Arrays algorithm.
+
The Union of two arrays is the collection of all the unique elements in the first array, combined with all of the unique elements of a second array. This implementation uses ordered arrays, and an algorithm to correctly order them and return the result as a new array (vector).
Author Alvin
+
+
+
◆ main()
+
+
+
+
+
+ int main
+ (
+ void
+ )
+
+
+
+
+
+
main function
+
Returns 0 on exit
+
+
+
+
+
static void test()
Function to test the correctness of get_union() function.
Definition: union_of_two_arrays.cpp:203
+
+
+
+
+
+
+
◆ test()
+
+
+
+
+
+
+
+
+ static void test
+ (
+ )
+
+
+
+
+
+static
+
+
+
+
+
Function to test the correctness of get_union() function.
+
Returns void
+
+
+
+
+
+
+
+
+
void test1()
< Use the BinaryTree
Definition: reverse_binary_tree.cpp:167
+
void test4()
A Test to check correct functionality with duplicate values.
Definition: union_of_two_arrays.cpp:149
+
void test3()
A Test to check correct reversal of a Binary Tree.
Definition: reverse_binary_tree.cpp:212
+
void test6()
A Test to check correct functionality with an array sorted using std::sort.
Definition: union_of_two_arrays.cpp:182
+
void test2()
A Test to check an edge case (NULL root element)
Definition: reverse_binary_tree.cpp:191
+
void test5()
A Test to check correct functionality with a harder test case.
Definition: union_of_two_arrays.cpp:165
+
+
+
+
+
+
+
+
+
+
+
diff --git a/d8/d9c/union__of__two__arrays_8cpp.js b/d8/d9c/union__of__two__arrays_8cpp.js
new file mode 100644
index 000000000..02f2d961f
--- /dev/null
+++ b/d8/d9c/union__of__two__arrays_8cpp.js
@@ -0,0 +1,13 @@
+var union__of__two__arrays_8cpp =
+[
+ [ "get_union", "d8/d9c/union__of__two__arrays_8cpp.html#a2b8ff06a84b041457873840bf82e2d74", null ],
+ [ "main", "d8/d9c/union__of__two__arrays_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ],
+ [ "print", "d8/d9c/union__of__two__arrays_8cpp.html#a6109193567a5b7e36a27f2b4865fce20", null ],
+ [ "test", "d8/d9c/union__of__two__arrays_8cpp.html#aa8dca7b867074164d5f45b0f3851269d", null ],
+ [ "test1", "d8/d9c/union__of__two__arrays_8cpp.html#a167c24bd817469ae47358d12e034f2d5", null ],
+ [ "test2", "d8/d9c/union__of__two__arrays_8cpp.html#abdd77344d4af8fd56d14a5cabbf2f669", null ],
+ [ "test3", "d8/d9c/union__of__two__arrays_8cpp.html#aa515639572647508b94986489aab6d76", null ],
+ [ "test4", "d8/d9c/union__of__two__arrays_8cpp.html#a2b9769e44683dcb67fe1083ad91e134d", null ],
+ [ "test5", "d8/d9c/union__of__two__arrays_8cpp.html#af7b81d7a1534216af6a36a80135beb86", null ],
+ [ "test6", "d8/d9c/union__of__two__arrays_8cpp.html#aacafde185abd8670abee51157f273dc2", null ]
+];
\ No newline at end of file
diff --git a/d8/d9c/union__of__two__arrays_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map b/d8/d9c/union__of__two__arrays_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map
new file mode 100644
index 000000000..963d3ffb5
--- /dev/null
+++ b/d8/d9c/union__of__two__arrays_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map
@@ -0,0 +1,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/d8/d9c/union__of__two__arrays_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 b/d8/d9c/union__of__two__arrays_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5
new file mode 100644
index 000000000..b68d2ff23
--- /dev/null
+++ b/d8/d9c/union__of__two__arrays_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5
@@ -0,0 +1 @@
+dd7e1d2eb4a0e958401a396a3f72dc22
\ 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
new file mode 100644
index 000000000..79c8f69a0
--- /dev/null
+++ b/d8/d9c/union__of__two__arrays_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg
@@ -0,0 +1,299 @@
+
+
+
+
+
+
+test
+
+
+
+Node1
+
+
+test
+
+
+
+
+
+Node2
+
+
+tests::test1
+
+
+
+
+
+Node1->Node2
+
+
+
+
+
+Node4
+
+
+tests::test2
+
+
+
+
+
+Node1->Node4
+
+
+
+
+
+Node5
+
+
+tests::test3
+
+
+
+
+
+Node1->Node5
+
+
+
+
+
+Node6
+
+
+tests::test4
+
+
+
+
+
+Node1->Node6
+
+
+
+
+
+Node13
+
+
+tests::test5
+
+
+
+
+
+Node1->Node13
+
+
+
+
+
+Node14
+
+
+tests::test6
+
+
+
+
+
+Node1->Node14
+
+
+
+
+
+Node3
+
+
+std::vector::size
+
+
+
+
+
+Node2->Node3
+
+
+
+
+
+Node4->Node3
+
+
+
+
+
+Node7
+
+
+operations_on_datastructures
+::get_union
+
+
+
+
+
+Node6->Node7
+
+
+
+
+
+Node10
+
+
+print
+
+
+
+
+
+Node6->Node10
+
+
+
+
+
+Node7->Node3
+
+
+
+
+
+Node8
+
+
+std::vector::back
+
+
+
+
+
+Node7->Node8
+
+
+
+
+
+Node9
+
+
+std::vector::push_back
+
+
+
+
+
+Node7->Node9
+
+
+
+
+
+Node11
+
+
+std::endl
+
+
+
+
+
+Node10->Node11
+
+
+
+
+
+Node12
+
+
+is_prime
+
+
+
+
+
+Node10->Node12
+
+
+
+
+
+Node13->Node7
+
+
+
+
+
+Node13->Node10
+
+
+
+
+
+Node14->Node7
+
+
+
+
+
+Node14->Node10
+
+
+
+
+
+Node15
+
+
+std::vector::begin
+
+
+
+
+
+Node14->Node15
+
+
+
+
+
+Node16
+
+
+std::vector::end
+
+
+
+
+
+Node14->Node16
+
+
+
+
+
+Node17
+
+
+std::sort
+
+
+
+
+
+Node14->Node17
+
+
+
+
+
diff --git a/d8/d9c/union__of__two__arrays_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map b/d8/d9c/union__of__two__arrays_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map
new file mode 100644
index 000000000..2290ba5d5
--- /dev/null
+++ b/d8/d9c/union__of__two__arrays_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/d8/d9c/union__of__two__arrays_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 b/d8/d9c/union__of__two__arrays_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5
new file mode 100644
index 000000000..f6063aa31
--- /dev/null
+++ b/d8/d9c/union__of__two__arrays_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5
@@ -0,0 +1 @@
+91a255ed58ff67d3fda69b096a388299
\ 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
new file mode 100644
index 000000000..c0f61ecff
--- /dev/null
+++ b/d8/d9c/union__of__two__arrays_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg
@@ -0,0 +1,402 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+main
+
+
+
+Node1
+
+
+main
+
+
+
+
+
+Node2
+
+
+test
+
+
+
+
+
+Node1->Node2
+
+
+
+
+
+Node3
+
+
+tests::test1
+
+
+
+
+
+Node2->Node3
+
+
+
+
+
+Node5
+
+
+tests::test2
+
+
+
+
+
+Node2->Node5
+
+
+
+
+
+Node6
+
+
+tests::test3
+
+
+
+
+
+Node2->Node6
+
+
+
+
+
+Node7
+
+
+tests::test4
+
+
+
+
+
+Node2->Node7
+
+
+
+
+
+Node14
+
+
+tests::test5
+
+
+
+
+
+Node2->Node14
+
+
+
+
+
+Node15
+
+
+tests::test6
+
+
+
+
+
+Node2->Node15
+
+
+
+
+
+Node4
+
+
+std::vector::size
+
+
+
+
+
+Node3->Node4
+
+
+
+
+
+Node5->Node4
+
+
+
+
+
+Node8
+
+
+operations_on_datastructures
+::get_union
+
+
+
+
+
+Node7->Node8
+
+
+
+
+
+Node11
+
+
+print
+
+
+
+
+
+Node7->Node11
+
+
+
+
+
+Node8->Node4
+
+
+
+
+
+Node9
+
+
+std::vector::back
+
+
+
+
+
+Node8->Node9
+
+
+
+
+
+Node10
+
+
+std::vector::push_back
+
+
+
+
+
+Node8->Node10
+
+
+
+
+
+Node12
+
+
+std::endl
+
+
+
+
+
+Node11->Node12
+
+
+
+
+
+Node13
+
+
+is_prime
+
+
+
+
+
+Node11->Node13
+
+
+
+
+
+Node14->Node8
+
+
+
+
+
+Node14->Node11
+
+
+
+
+
+Node15->Node8
+
+
+
+
+
+Node15->Node11
+
+
+
+
+
+Node16
+
+
+std::vector::begin
+
+
+
+
+
+Node15->Node16
+
+
+
+
+
+Node17
+
+
+std::vector::end
+
+
+
+
+
+Node15->Node17
+
+
+
+
+
+Node18
+
+
+std::sort
+
+
+
+
+
+Node15->Node18
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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
new file mode 100644
index 000000000..ca6fa2360
--- /dev/null
+++ b/d8/d9c/union__of__two__arrays_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg
@@ -0,0 +1,314 @@
+
+
+
+
+
+
+main
+
+
+
+Node1
+
+
+main
+
+
+
+
+
+Node2
+
+
+test
+
+
+
+
+
+Node1->Node2
+
+
+
+
+
+Node3
+
+
+tests::test1
+
+
+
+
+
+Node2->Node3
+
+
+
+
+
+Node5
+
+
+tests::test2
+
+
+
+
+
+Node2->Node5
+
+
+
+
+
+Node6
+
+
+tests::test3
+
+
+
+
+
+Node2->Node6
+
+
+
+
+
+Node7
+
+
+tests::test4
+
+
+
+
+
+Node2->Node7
+
+
+
+
+
+Node14
+
+
+tests::test5
+
+
+
+
+
+Node2->Node14
+
+
+
+
+
+Node15
+
+
+tests::test6
+
+
+
+
+
+Node2->Node15
+
+
+
+
+
+Node4
+
+
+std::vector::size
+
+
+
+
+
+Node3->Node4
+
+
+
+
+
+Node5->Node4
+
+
+
+
+
+Node8
+
+
+operations_on_datastructures
+::get_union
+
+
+
+
+
+Node7->Node8
+
+
+
+
+
+Node11
+
+
+print
+
+
+
+
+
+Node7->Node11
+
+
+
+
+
+Node8->Node4
+
+
+
+
+
+Node9
+
+
+std::vector::back
+
+
+
+
+
+Node8->Node9
+
+
+
+
+
+Node10
+
+
+std::vector::push_back
+
+
+
+
+
+Node8->Node10
+
+
+
+
+
+Node12
+
+
+std::endl
+
+
+
+
+
+Node11->Node12
+
+
+
+
+
+Node13
+
+
+is_prime
+
+
+
+
+
+Node11->Node13
+
+
+
+
+
+Node14->Node8
+
+
+
+
+
+Node14->Node11
+
+
+
+
+
+Node15->Node8
+
+
+
+
+
+Node15->Node11
+
+
+
+
+
+Node16
+
+
+std::vector::begin
+
+
+
+
+
+Node15->Node16
+
+
+
+
+
+Node17
+
+
+std::vector::end
+
+
+
+
+
+Node15->Node17
+
+
+
+
+
+Node18
+
+
+std::sort
+
+
+
+
+
+Node15->Node18
+
+
+
+
+
diff --git a/d9/df4/namespacetests.html b/d9/df4/namespacetests.html
index 693345a6f..7d10808e4 100644
--- a/d9/df4/namespacetests.html
+++ b/d9/df4/namespacetests.html
@@ -110,9 +110,19 @@ Functions
void test3 ()
A Test to check correct reversal of a Binary Tree. More...
+void test4 ()
+ A Test to check correct functionality with duplicate values. More...
+
+void test5 ()
+ A Test to check correct functionality with a harder test case. More...
+
+void test6 ()
+ A Test to check correct functionality with an array sorted using std::sort . More...
+
Testcases to check Reversal of Binary Tree.
+
Testcases to check Union of Two Arrays.
◆ test1()
@@ -130,10 +140,16 @@ Functions
< Use the BinaryTree
-
A Test to check an edge case (single element reversal)
+
A Test to check an edge case (two empty arrays)
+
A Test to check an edge case (single element reversal)
+
Returns void
< Check for equal sizes
< Ensure that there is only one element
< Check if both elements are same
+
< Check if result is empty
+
< Should only print newline
+
< Check if result is empty
+
< Should only print newline
@@ -183,8 +199,14 @@ Here is the call graph for this function:
A Test to check an edge case (NULL root element)
+
A Test to check an edge case (one empty array)
+
Returns void
< Check for equal sizes
< Ensure that there is only one element
+
< Check if result is equal to b
+
< Should print 2 3
+
< Check if result is equal to b
+
< Should print 2 3
@@ -228,8 +250,14 @@ Here is the call graph for this function:
A Test to check correct reversal of a Binary Tree.
+
A Test to check correct functionality with a simple test case.
+
Returns void
< Check for equality
< Check for equality
+
< Check if result is correct
+
< Should print 2 3 4 6
+
< Check if result is correct
+
< Should print 2 3 4 6
@@ -256,6 +284,137 @@ Here is the call graph for this function:
+
+
+
+◆ test4()
+
+
+
+
+
+ void tests::test4
+ (
+ )
+
+
+
+
+
+
A Test to check correct functionality with duplicate values.
+
Returns void
+
< Check if result is correct
+
< Should print 2 3 4 6 7
+
+
+
151 std::cout <<
"Intialized a = {4, 6, 6, 7} b = {2, 3, 4}\n" ;
+
152 std::cout <<
"Expected result: {2, 3, 4, 6, 7}\n" ;
+
+
+
+
+
157 assert(result == expected);
+
+
+
+
uint64_t result(uint64_t n)
Definition: fibonacci_sum.cpp:76
+
std::vector< int32_t > get_union(const std::vector< int32_t > &first, const std::vector< int32_t > &second)
Gets the union of two sorted arrays, and returns them in a vector.
Definition: union_of_two_arrays.cpp:48
+
void print(uint32_t N, const std::vector< bool > &is_prime)
Definition: sieve_of_eratosthenes.cpp:44
+
+
+
+
+
+
+◆ test5()
+
+
+
+
+
+ void tests::test5
+ (
+ )
+
+
+
+
+
+
A Test to check correct functionality with a harder test case.
+
Returns void
+
< Check if result is correct
+
< Should print 1 2 3 4 5 6 7 9
+
+
+
167 std::cout <<
"Intialized a = {1, 4, 6, 7, 9} b = {2, 3, 5}\n" ;
+
168 std::cout <<
"Expected result: {1, 2, 3, 4, 5, 6, 7, 9}\n" ;
+
+
+
+
+
173 assert(result == expected);
+
+
+
+
+
+
+
+
+
+◆ test6()
+
+
+
+
+
+ void tests::test6
+ (
+ )
+
+
+
+
+
+
A Test to check correct functionality with an array sorted using std::sort .
+
Returns void
+
< Sort vector a
+
< Sort vector b
+
< Check if result is correct
+
< Should print 1 2 3 4 5 6 7 8 9 11
+
+
+
184 std::cout <<
"Intialized a = {1, 3, 3, 2, 5, 9, 4, 3, 2} " ;
+
+
186 std::cout <<
"Expected result: {1, 2, 3, 4, 5, 6, 7, 8, 9, 11}\n" ;
+
+
+
+
+
+
+
193 assert(result == expected);
+
+
+
+
+
+
+
+
+
diff --git a/d9/df4/namespacetests_a2b9769e44683dcb67fe1083ad91e134d_cgraph.map b/d9/df4/namespacetests_a2b9769e44683dcb67fe1083ad91e134d_cgraph.map
new file mode 100644
index 000000000..eb240f5a2
--- /dev/null
+++ b/d9/df4/namespacetests_a2b9769e44683dcb67fe1083ad91e134d_cgraph.map
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/d9/df4/namespacetests_a2b9769e44683dcb67fe1083ad91e134d_cgraph.md5 b/d9/df4/namespacetests_a2b9769e44683dcb67fe1083ad91e134d_cgraph.md5
new file mode 100644
index 000000000..0049de821
--- /dev/null
+++ b/d9/df4/namespacetests_a2b9769e44683dcb67fe1083ad91e134d_cgraph.md5
@@ -0,0 +1 @@
+c7dd5f787f6905f619ecb2f1305e0a0c
\ No newline at end of file
diff --git a/d9/df4/namespacetests_a2b9769e44683dcb67fe1083ad91e134d_cgraph.svg b/d9/df4/namespacetests_a2b9769e44683dcb67fe1083ad91e134d_cgraph.svg
new file mode 100644
index 000000000..d65a98bef
--- /dev/null
+++ b/d9/df4/namespacetests_a2b9769e44683dcb67fe1083ad91e134d_cgraph.svg
@@ -0,0 +1,128 @@
+
+
+
+
+
+
+tests::test4
+
+
+
+Node1
+
+
+tests::test4
+
+
+
+
+
+Node2
+
+
+operations_on_datastructures
+::get_union
+
+
+
+
+
+Node1->Node2
+
+
+
+
+
+Node6
+
+
+print
+
+
+
+
+
+Node1->Node6
+
+
+
+
+
+Node3
+
+
+std::vector::back
+
+
+
+
+
+Node2->Node3
+
+
+
+
+
+Node4
+
+
+std::vector::push_back
+
+
+
+
+
+Node2->Node4
+
+
+
+
+
+Node5
+
+
+std::vector::size
+
+
+
+
+
+Node2->Node5
+
+
+
+
+
+Node7
+
+
+std::endl
+
+
+
+
+
+Node6->Node7
+
+
+
+
+
+Node8
+
+
+is_prime
+
+
+
+
+
+Node6->Node8
+
+
+
+
+
diff --git a/d9/df4/namespacetests_aacafde185abd8670abee51157f273dc2_cgraph.map b/d9/df4/namespacetests_aacafde185abd8670abee51157f273dc2_cgraph.map
new file mode 100644
index 000000000..4d79b71c5
--- /dev/null
+++ b/d9/df4/namespacetests_aacafde185abd8670abee51157f273dc2_cgraph.map
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/d9/df4/namespacetests_aacafde185abd8670abee51157f273dc2_cgraph.md5 b/d9/df4/namespacetests_aacafde185abd8670abee51157f273dc2_cgraph.md5
new file mode 100644
index 000000000..3dc77840f
--- /dev/null
+++ b/d9/df4/namespacetests_aacafde185abd8670abee51157f273dc2_cgraph.md5
@@ -0,0 +1 @@
+fff1ea433f7e8b2767fbb6b885ebdd98
\ No newline at end of file
diff --git a/d9/df4/namespacetests_aacafde185abd8670abee51157f273dc2_cgraph.svg b/d9/df4/namespacetests_aacafde185abd8670abee51157f273dc2_cgraph.svg
new file mode 100644
index 000000000..09b80c7e5
--- /dev/null
+++ b/d9/df4/namespacetests_aacafde185abd8670abee51157f273dc2_cgraph.svg
@@ -0,0 +1,173 @@
+
+
+
+
+
+
+tests::test6
+
+
+
+Node1
+
+
+tests::test6
+
+
+
+
+
+Node2
+
+
+std::vector::begin
+
+
+
+
+
+Node1->Node2
+
+
+
+
+
+Node3
+
+
+std::vector::end
+
+
+
+
+
+Node1->Node3
+
+
+
+
+
+Node4
+
+
+operations_on_datastructures
+::get_union
+
+
+
+
+
+Node1->Node4
+
+
+
+
+
+Node8
+
+
+print
+
+
+
+
+
+Node1->Node8
+
+
+
+
+
+Node11
+
+
+std::sort
+
+
+
+
+
+Node1->Node11
+
+
+
+
+
+Node5
+
+
+std::vector::back
+
+
+
+
+
+Node4->Node5
+
+
+
+
+
+Node6
+
+
+std::vector::push_back
+
+
+
+
+
+Node4->Node6
+
+
+
+
+
+Node7
+
+
+std::vector::size
+
+
+
+
+
+Node4->Node7
+
+
+
+
+
+Node9
+
+
+std::endl
+
+
+
+
+
+Node8->Node9
+
+
+
+
+
+Node10
+
+
+is_prime
+
+
+
+
+
+Node8->Node10
+
+
+
+
+
diff --git a/d9/df4/namespacetests_af7b81d7a1534216af6a36a80135beb86_cgraph.map b/d9/df4/namespacetests_af7b81d7a1534216af6a36a80135beb86_cgraph.map
new file mode 100644
index 000000000..fee527a81
--- /dev/null
+++ b/d9/df4/namespacetests_af7b81d7a1534216af6a36a80135beb86_cgraph.map
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/d9/df4/namespacetests_af7b81d7a1534216af6a36a80135beb86_cgraph.md5 b/d9/df4/namespacetests_af7b81d7a1534216af6a36a80135beb86_cgraph.md5
new file mode 100644
index 000000000..dcee7f5db
--- /dev/null
+++ b/d9/df4/namespacetests_af7b81d7a1534216af6a36a80135beb86_cgraph.md5
@@ -0,0 +1 @@
+89fa3e8dc2e843084451722be443a20b
\ No newline at end of file
diff --git a/d9/df4/namespacetests_af7b81d7a1534216af6a36a80135beb86_cgraph.svg b/d9/df4/namespacetests_af7b81d7a1534216af6a36a80135beb86_cgraph.svg
new file mode 100644
index 000000000..a61affdcf
--- /dev/null
+++ b/d9/df4/namespacetests_af7b81d7a1534216af6a36a80135beb86_cgraph.svg
@@ -0,0 +1,128 @@
+
+
+
+
+
+
+tests::test5
+
+
+
+Node1
+
+
+tests::test5
+
+
+
+
+
+Node2
+
+
+operations_on_datastructures
+::get_union
+
+
+
+
+
+Node1->Node2
+
+
+
+
+
+Node6
+
+
+print
+
+
+
+
+
+Node1->Node6
+
+
+
+
+
+Node3
+
+
+std::vector::back
+
+
+
+
+
+Node2->Node3
+
+
+
+
+
+Node4
+
+
+std::vector::push_back
+
+
+
+
+
+Node2->Node4
+
+
+
+
+
+Node5
+
+
+std::vector::size
+
+
+
+
+
+Node2->Node5
+
+
+
+
+
+Node7
+
+
+std::endl
+
+
+
+
+
+Node6->Node7
+
+
+
+
+
+Node8
+
+
+is_prime
+
+
+
+
+
+Node6->Node8
+
+
+
+
+
diff --git a/da/d6d/namespaceoperations__on__datastructures.html b/da/d6d/namespaceoperations__on__datastructures.html
index 0da573276..e51699a49 100644
--- a/da/d6d/namespaceoperations__on__datastructures.html
+++ b/da/d6d/namespaceoperations__on__datastructures.html
@@ -90,12 +90,24 @@ $(document).ready(function(){initNavTree('da/d6d/namespaceoperations__on__datast
for std::vector
More...
+
for std::vector
for std::priority_queue
@@ -105,8 +117,154 @@ $(document).ready(function(){initNavTree('da/d6d/namespaceoperations__on__datast
For assert For IO operations For std::queue
Operations on Data Structures
for std::count for assert for tolower for string operations for IO Operations
-
Operations on data structures
-
+Operations on data structures
+for std::sort for assert for IO operations
+Operations on Data Structures
+
+
+◆ get_union()
+
+
+
+
+
+ std::vector < int32_t > operations_on_datastructures::get_union
+ (
+ const std::vector < int32_t > &
+ first ,
+
+
+
+
+ const std::vector < int32_t > &
+ second
+
+
+
+ )
+
+
+
+
+
+
Gets the union of two sorted arrays, and returns them in a vector.
+
An algorithm is used that compares the elements of the two vectors, appending the one that has a lower value, and incrementing the index for that array. If one of the arrays reaches its end, all the elements of the other are appended to the resultant vector.
Parameters
+
+
+
+
Returns A std::vector of the union of the two arrays, in ascending order
+
< Vector to hold the union
+
< Index for the first array
+
< Index for the second array
+
< Length of first array
+
< Length of second array
+
< Integer to store value of the next element
+
< Append from first array
+
< Increment index of second array
+
< Append from second array
+
< Increment index of second array
+
< Element is the same in both
+
< Increment index of first array
+
< Increment index of second array too
+
< Add the element if it is unique
+
< Add remaining elements
+
< Add the element if it is unique
+
< Add remaining elements
+
< Add the element if it is unique
+
+
+
+
+
53 size_t f_length = first.
size ();
+
54 size_t s_length = second.
size ();
+
+
+
57 while (f_index < f_length && s_index < s_length) {
+
58 if (first[f_index] < second[s_index]) {
+
59 next = first[f_index];
+
+
61 }
else if (first[f_index] > second[s_index]) {
+
62 next = second[s_index];
+
+
+
65 next = first[f_index];
+
+
+
+
69 if ((res.
size () == 0) || (next != res.
back ())) {
+
+
+
+
73 while (f_index < f_length) {
+
74 next = first[f_index];
+
75 if ((res.
size () == 0) || (next != res.
back ())) {
+
+
+
+
+
80 while (s_index < s_length) {
+
81 next = second[s_index];
+
82 if ((res.
size () == 0) || (next != res.
back ())) {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+◆ print()
+
+
+
+
+
+ void operations_on_datastructures::print
+ (
+ const std::vector < int32_t > &
+ array )
+
+
+
+
+
+
Prints the values of a vector sequentially, ending with a newline character.
+
Parameters
+
+ array Reference to the array to be printed
+
+
+
+
Returns void
+
Print each value in the array
+
Print newline
+
+
31 for (int64_t i : array) {
+
+
+
+
+
+
+
+
+
diff --git a/da/d6d/namespaceoperations__on__datastructures.js b/da/d6d/namespaceoperations__on__datastructures.js
index e256ba2d3..4636ab3d4 100644
--- a/da/d6d/namespaceoperations__on__datastructures.js
+++ b/da/d6d/namespaceoperations__on__datastructures.js
@@ -17,5 +17,7 @@ var namespaceoperations__on__datastructures =
] ],
[ "trie_operations", null, [
[ "Tnode", "d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode.html", "d0/d5f/classoperations__on__datastructures_1_1trie__operations_1_1_tnode" ]
- ] ]
+ ] ],
+ [ "get_union", "da/d6d/namespaceoperations__on__datastructures.html#a2b8ff06a84b041457873840bf82e2d74", null ],
+ [ "print", "da/d6d/namespaceoperations__on__datastructures.html#a6109193567a5b7e36a27f2b4865fce20", null ]
];
\ No newline at end of file
diff --git a/da/d6d/namespaceoperations__on__datastructures_a2b8ff06a84b041457873840bf82e2d74_cgraph.map b/da/d6d/namespaceoperations__on__datastructures_a2b8ff06a84b041457873840bf82e2d74_cgraph.map
new file mode 100644
index 000000000..dadf662d8
--- /dev/null
+++ b/da/d6d/namespaceoperations__on__datastructures_a2b8ff06a84b041457873840bf82e2d74_cgraph.map
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/da/d6d/namespaceoperations__on__datastructures_a2b8ff06a84b041457873840bf82e2d74_cgraph.md5 b/da/d6d/namespaceoperations__on__datastructures_a2b8ff06a84b041457873840bf82e2d74_cgraph.md5
new file mode 100644
index 000000000..d245c5de3
--- /dev/null
+++ b/da/d6d/namespaceoperations__on__datastructures_a2b8ff06a84b041457873840bf82e2d74_cgraph.md5
@@ -0,0 +1 @@
+c8231bf6aeb9db2f04b06867c09f7db2
\ No newline at end of file
diff --git a/da/d6d/namespaceoperations__on__datastructures_a2b8ff06a84b041457873840bf82e2d74_cgraph.svg b/da/d6d/namespaceoperations__on__datastructures_a2b8ff06a84b041457873840bf82e2d74_cgraph.svg
new file mode 100644
index 000000000..c1abb281b
--- /dev/null
+++ b/da/d6d/namespaceoperations__on__datastructures_a2b8ff06a84b041457873840bf82e2d74_cgraph.svg
@@ -0,0 +1,68 @@
+
+
+
+
+
+
+operations_on_datastructures::get_union
+
+
+
+Node1
+
+
+operations_on_datastructures
+::get_union
+
+
+
+
+
+Node2
+
+
+std::vector::back
+
+
+
+
+
+Node1->Node2
+
+
+
+
+
+Node3
+
+
+std::vector::push_back
+
+
+
+
+
+Node1->Node3
+
+
+
+
+
+Node4
+
+
+std::vector::size
+
+
+
+
+
+Node1->Node4
+
+
+
+
+
diff --git a/dir_35422be6552f1b3672c1b6c4aba2da64.html b/dir_35422be6552f1b3672c1b6c4aba2da64.html
index 62aad1619..fb47d77f7 100644
--- a/dir_35422be6552f1b3672c1b6c4aba2da64.html
+++ b/dir_35422be6552f1b3672c1b6c4aba2da64.html
@@ -105,6 +105,9 @@ Files
file trie_multiple_search.cpp
Trie datastructure with search variants
+
file union_of_two_arrays.cpp
+
Implementation for the Union of two sorted Arrays algorithm.
+
diff --git a/dir_35422be6552f1b3672c1b6c4aba2da64.js b/dir_35422be6552f1b3672c1b6c4aba2da64.js
index 2d45520f9..1539f384f 100644
--- a/dir_35422be6552f1b3672c1b6c4aba2da64.js
+++ b/dir_35422be6552f1b3672c1b6c4aba2da64.js
@@ -2,5 +2,6 @@ var dir_35422be6552f1b3672c1b6c4aba2da64 =
[
[ "inorder_successor_of_bst.cpp", "d4/d32/inorder__successor__of__bst_8cpp.html", "d4/d32/inorder__successor__of__bst_8cpp" ],
[ "reverse_binary_tree.cpp", "d4/db6/reverse__binary__tree_8cpp.html", "d4/db6/reverse__binary__tree_8cpp" ],
- [ "trie_multiple_search.cpp", "d7/def/trie__multiple__search_8cpp.html", "d7/def/trie__multiple__search_8cpp" ]
+ [ "trie_multiple_search.cpp", "d7/def/trie__multiple__search_8cpp.html", "d7/def/trie__multiple__search_8cpp" ],
+ [ "union_of_two_arrays.cpp", "d8/d9c/union__of__two__arrays_8cpp.html", "d8/d9c/union__of__two__arrays_8cpp" ]
];
\ No newline at end of file
diff --git a/files.html b/files.html
index 01c57eb65..8e4eb6ebc 100644
--- a/files.html
+++ b/files.html
@@ -270,6 +270,7 @@ solve-a-rat-in-a-maze-c-java-pytho/"
inorder_successor_of_bst.cpp An implementation for finding the Inorder successor of a binary search tree Inorder successor of a node is the next node in Inorder traversal of the Binary Tree. Inorder Successor is NULL for the last node in Inorder traversal
reverse_binary_tree.cpp Implementation for the Reversing a Binary Tree recursively algorithm
trie_multiple_search.cpp Trie datastructure with search variants
+ union_of_two_arrays.cpp Implementation for the Union of two sorted Arrays algorithm
► others
buzz_number.cpp A buzz number is a number that is either divisible by 7 or has last digit as 7
decimal_to_binary.cpp Function to convert decimal number to binary representation
diff --git a/globals_func_m.html b/globals_func_m.html
index aba96b79a..586e2e61e 100644
--- a/globals_func_m.html
+++ b/globals_func_m.html
@@ -93,7 +93,7 @@ $(document).ready(function(){initNavTree('globals_func_m.html',''); initResizabl
- m -