From 3813662f94f4c68ef499a23dc87183319e925f9b Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Tue, 26 Oct 2021 04:18:22 +0000 Subject: [PATCH] Documentation for e5135d8bd812f4348c1deffda897e80a97111c35 --- d4/db6/reverse__binary__tree_8cpp.html | 6 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.map | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.md5 | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 4 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 4 +- ...b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg | 4 +- d6/d57/array__right__rotation_8cpp.html | 12 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.map | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.md5 | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 4 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 4 +- ...b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg | 4 +- d8/d9c/union__of__two__arrays_8cpp.html | 10 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.map | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.md5 | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 4 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 4 +- ...b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg | 4 +- d9/d14/array__left__rotation_8cpp.html | 243 ++++++++++ d9/d14/array__left__rotation_8cpp.js | 12 + ...8dca7b867074164d5f45b0f3851269d_cgraph.map | 14 + ...8dca7b867074164d5f45b0f3851269d_cgraph.md5 | 1 + ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 236 ++++++++++ ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 15 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 339 ++++++++++++++ ...b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg | 251 +++++++++++ d9/df4/namespacetests.html | 138 +++--- ...67c24bd817469ae47358d12e034f2d5_cgraph.map | 2 +- ...67c24bd817469ae47358d12e034f2d5_cgraph.md5 | 2 +- ...67c24bd817469ae47358d12e034f2d5_cgraph.svg | 4 +- ...b9769e44683dcb67fe1083ad91e134d_cgraph.map | 2 +- ...b9769e44683dcb67fe1083ad91e134d_cgraph.md5 | 2 +- ...b9769e44683dcb67fe1083ad91e134d_cgraph.svg | 4 +- ...515639572647508b94986489aab6d76_cgraph.map | 2 +- ...515639572647508b94986489aab6d76_cgraph.md5 | 2 +- ...515639572647508b94986489aab6d76_cgraph.svg | 4 +- ...dd77344d4af8fd56d14a5cabbf2f669_cgraph.map | 2 +- ...dd77344d4af8fd56d14a5cabbf2f669_cgraph.md5 | 2 +- ...dd77344d4af8fd56d14a5cabbf2f669_cgraph.svg | 4 +- ...7b81d7a1534216af6a36a80135beb86_cgraph.map | 2 +- ...7b81d7a1534216af6a36a80135beb86_cgraph.md5 | 2 +- ...7b81d7a1534216af6a36a80135beb86_cgraph.svg | 4 +- ...mespaceoperations__on__datastructures.html | 81 +++- ...namespaceoperations__on__datastructures.js | 1 + ...ce39cf843989a39811a49ebe29dd6d8_cgraph.map | 4 + ...ce39cf843989a39811a49ebe29dd6d8_cgraph.md5 | 1 + ...ce39cf843989a39811a49ebe29dd6d8_cgraph.svg | 38 ++ dd/d2b/array__left__rotation_8cpp__incl.map | 6 + dd/d2b/array__left__rotation_8cpp__incl.md5 | 1 + dd/d2b/array__left__rotation_8cpp__incl.svg | 68 +++ .../intersection__of__two__arrays_8cpp.html | 10 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.map | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.md5 | 2 +- ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 4 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 2 +- ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 4 +- ...b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg | 4 +- dir_35422be6552f1b3672c1b6c4aba2da64.html | 3 + dir_35422be6552f1b3672c1b6c4aba2da64.js | 1 + files.html | 13 +- globals_func_m.html | 2 +- globals_func_s.html | 2 +- globals_func_t.html | 2 +- globals_m.html | 2 +- globals_s.html | 2 +- globals_t.html | 2 +- namespacemembers.html | 1 + namespacemembers_func.html | 1 + navtreedata.js | 10 +- navtreeindex0.js | 50 +-- navtreeindex1.js | 44 +- navtreeindex10.js | 54 +-- navtreeindex11.js | 38 +- navtreeindex12.js | 86 ++-- navtreeindex13.js | 86 ++-- navtreeindex14.js | 139 +++--- navtreeindex2.js | 60 +-- navtreeindex3.js | 38 +- navtreeindex4.js | 94 ++-- navtreeindex5.js | 72 +-- navtreeindex6.js | 70 +-- navtreeindex7.js | 46 +- navtreeindex8.js | 72 +-- navtreeindex9.js | 70 +-- search/all_14.js | 417 +++++++++--------- search/all_15.js | 6 +- search/all_2.js | 113 ++--- search/all_e.js | 10 +- search/files_1.js | 7 +- search/functions_13.js | 281 ++++++------ search/functions_14.js | 4 +- search/functions_d.js | 4 +- 100 files changed, 2422 insertions(+), 1088 deletions(-) create mode 100644 d9/d14/array__left__rotation_8cpp.html create mode 100644 d9/d14/array__left__rotation_8cpp.js create mode 100644 d9/d14/array__left__rotation_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map create mode 100644 d9/d14/array__left__rotation_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 create mode 100644 d9/d14/array__left__rotation_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg create mode 100644 d9/d14/array__left__rotation_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 d9/d14/array__left__rotation_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 d9/d14/array__left__rotation_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg create mode 100644 d9/d14/array__left__rotation_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph_org.svg create mode 100644 da/d6d/namespaceoperations__on__datastructures_afce39cf843989a39811a49ebe29dd6d8_cgraph.map create mode 100644 da/d6d/namespaceoperations__on__datastructures_afce39cf843989a39811a49ebe29dd6d8_cgraph.md5 create mode 100644 da/d6d/namespaceoperations__on__datastructures_afce39cf843989a39811a49ebe29dd6d8_cgraph.svg create mode 100644 dd/d2b/array__left__rotation_8cpp__incl.map create mode 100644 dd/d2b/array__left__rotation_8cpp__incl.md5 create mode 100644 dd/d2b/array__left__rotation_8cpp__incl.svg diff --git a/d4/db6/reverse__binary__tree_8cpp.html b/d4/db6/reverse__binary__tree_8cpp.html index 07749d8d3..3526c6d4a 100644 --- a/d4/db6/reverse__binary__tree_8cpp.html +++ b/d4/db6/reverse__binary__tree_8cpp.html @@ -218,9 +218,9 @@ Here is the call graph for this function:
- -Implementation for the Array right Rotation algorithm.
-Shifting an array to the right involves moving each element of the array so that it occupies a position of a certain shift value after its current one. This implementation uses a result vector and does not mutate the input.
Shifting an array to the right involves moving each element of the array so that it occupies a position of a certain shift value after its current one. This implementation uses a result vector and does not mutate the input.
|
+ Algorithms_in_C++ 1.0.0
+
+ Set of algorithms implemented in C++.
+ |
+
Implementation for the Array Left Rotation algorithm. +More...
+#include <cassert>#include <iostream>#include <vector>+Namespaces | |
| namespace | operations_on_datastructures |
| for std::vector | |
| namespace | tests |
| Testcases to check Union of Two Arrays. | |
+Functions | |
| void | operations_on_datastructures::print (const std::vector< int32_t > &array) |
| Prints the values of a vector sequentially, ending with a newline character. More... | |
| std::vector< int32_t > | operations_on_datastructures::shift_left (const std::vector< int32_t > &array, size_t shift) |
| Shifts the given vector to the left by the shift amount and returns a new vector with the result. The original vector is not mutated. More... | |
| void | tests::test1 () |
| A Test to check an simple case. More... | |
| void | tests::test2 () |
| A Test to check an empty vector. More... | |
| void | tests::test3 () |
| A Test to check an invalid shift value. More... | |
| void | tests::test4 () |
| A Test to check a very large input. More... | |
| void | tests::test5 () |
| A Test to check a shift of zero. More... | |
| static void | test () |
| Function to test the correctness of shift_left() function. More... | |
| int | main () |
| main function More... | |
Implementation for the Array Left Rotation algorithm.
+Shifting an array to the left involves moving each element of the array so that it occupies a position of a certain shift value before its current one. This implementation uses a result vector and does not mutate the input.
+| int main | +( | +void | +) | ++ |
+
|
+ +static | +
Function to test the correctness of shift_left() function.
+A Test to check an edge case (two empty arrays)
A Test to check an edge case (single element reversal)
+< Should print 3 4 5 1 2
< Should print 4 5 1 2 3
< Check if result is empty
< Should only print newline
@@ -153,6 +154,7 @@ Functions< Check if both elements are same
< Check if result is empty
< Should only print newline
+< Should print 4 5 1 2 3
< Check if result is empty
< Should only print newline
< Check for equal sizes
@@ -160,19 +162,19 @@ Functions< Check if both elements are same
< Check if result is empty
< Should only print newline
-A Test to check an edge case (one empty array)
< Should print empty newline
+< Should print empty newline
< Check if result is equal to a
< Should only print newline
< Check for equal sizes
< Ensure that there is only one element
< Check if result is equal to b
< Should print 2 3
+< Should print empty newline
< Check if result is equal to a
< Should only print newline
< Check for equal sizes
< Ensure that there is only one element
< Check if result is equal to b
< Should print 2 3
-< 7 > 5
< Should print empty newline
+< 7 > 5
+< Should print empty newline
< Check if result is correct
< Should print 6
< Check for equality
< Check for equality
< Check if result is correct
< Should print 2 3 4 6
+< 7 > 5
+< Should print empty newline
< Check if result is correct
< Should print 6
< Check for equality
< Check for equality
< Check if result is correct
< Should print 2 3 4 6
-A Test to check a very large input.
A Test to check correct functionality with duplicate values.
< Should print {4, 6, ..., 420, 2}
< Should print {420, 2, 4, ..., 418}
< Check if result is correct
< Should print 4 6
< Check if result is correct
< Should print 2 3 4 6 7
+< Should print {420, 2, 4, ..., 418}
< Check if result is correct
< Should print 4 6
< Check if result is correct
< Should print 2 3 4 6 7
-A Test to check correct functionality with a harder test case.
< Should print 1 2 3 4 5
+< Should print 1 2 3 4 5
< Check if result is correct
< Should print 2 3 4
< Check if result is correct
< Should print 1 2 3 4 5 6 7 9
+< Should print 1 2 3 4 5
< Check if result is correct
< Should print 2 3 4
< Check if result is correct
< Should print 1 2 3 4 5 6 7 9
-Print newline
Print each value in the array
Print newline
-Print each value in the array
+Print newline
+Print each value in the array
+Print newline
+ +| std::vector< int32_t > operations_on_datastructures::shift_left | +( | +const std::vector< int32_t > & | +array, | +
| + | + | size_t | +shift | +
| + | ) | ++ |
Shifts the given vector to the left by the shift amount and returns a new vector with the result. The original vector is not mutated.
+Shifts the values of the vector, by creating a new vector and adding values from the shift index to the end, then appending the rest of the elements from the start of the vector.
| array | A reference to the input std::vector |
| shift | The amount to be shifted to the left |
< We got an invalid shift, return empty array
+< Result array
+< Add values after the shift index
+< Add the values from the start
+Files | |
| file | array_left_rotation.cpp |
| Implementation for the Array Left Rotation algorithm. | |
| file | array_right_rotation.cpp |
| Implementation for the Array right Rotation algorithm. | |
| ► operations_on_datastructures | |
| ► others | |