From 565a70530936df7961ccb8a67c9aa3f24e42c6ef Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Sat, 14 Nov 2020 02:04:38 +0000 Subject: [PATCH] Documentation for b4b182a61dbba7080200ecfedbe4dcb371b8e0d7 --- annotated.html | 23 +- annotated_dup.js | 1 - classes.html | 2 +- d0/dd2/class_queue___array.js | 11 - d1/d6d/queue__using__array_8cpp__incl.map | 5 + d1/d6d/queue__using__array_8cpp__incl.md5 | 1 + d1/d6d/queue__using__array_8cpp__incl.svg | 53 ++ d1/d9a/hopcroft__karp_8cpp.html | 12 +- d4/d8d/jarvis__algorithm_8cpp.html | 2 +- d5/d33/gram__schmidt_8cpp.html | 2 +- d5/d3c/namespacedata__structures.html | 3 +- d5/d3c/namespacedata__structures.js | 3 + d5/d88/md__d_i_r_e_c_t_o_r_y.html | 40 +- d5/ddb/bogo__sort_8cpp.html | 2 +- ...queue__using__array_1_1_queue___array.html | 279 ++++++++++ ..._1queue__using__array_1_1_queue___array.js | 9 + ...aaf88c9954ef3ab686f8e4bfbd87622_cgraph.map | 4 + ...aaf88c9954ef3ab686f8e4bfbd87622_cgraph.md5 | 1 + ...aaf88c9954ef3ab686f8e4bfbd87622_cgraph.svg | 39 ++ ...dc64488c36f84d927365fa8d1933663_cgraph.map | 4 + ...dc64488c36f84d927365fa8d1933663_cgraph.md5 | 1 + ...dc64488c36f84d927365fa8d1933663_cgraph.svg | 39 ++ ...88b7ea064739ea9fa66bf64bf4ae631_cgraph.map | 4 + ...88b7ea064739ea9fa66bf64bf4ae631_cgraph.md5 | 1 + ...88b7ea064739ea9fa66bf64bf4ae631_cgraph.svg | 39 ++ d6/d10/cut__rod_8cpp.html | 2 +- d7/de0/stack_8h_source.html | 15 +- ...sing__array_1_1_queue___array-members.html | 20 +- d8/df0/queue__using__array_8cpp.html | 252 +++++++++ d8/df0/queue__using__array_8cpp.js | 6 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 8 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 109 ++++ .../d70/namespacequeue__using__array.html | 54 +- ...__array_1_1_queue___array__coll__graph.map | 5 + ...__array_1_1_queue___array__coll__graph.md5 | 1 + ...__array_1_1_queue___array__coll__graph.svg | 56 ++ db/d16/0__1__knapsack_8cpp.html | 2 +- db/dca/kadane2_8cpp.html | 2 +- dir_2e746e9d06bf2d8ff842208bcc6ebcfc.html | 3 + dir_2e746e9d06bf2d8ff842208bcc6ebcfc.js | 1 + files.html | 11 +- functions_a.html | 3 +- functions_d.html | 4 + functions_e.html | 3 + functions_f.html | 5 +- functions_func_d.html | 4 + functions_func_e.html | 3 + functions_r.html | 3 + functions_vars.html | 9 +- globals_func_m.html | 45 +- globals_i.html | 6 +- globals_m.html | 88 ++-- globals_vars.html | 3 + hierarchy.html | 2 +- hierarchy.js | 2 +- index.html | 8 +- inherit_graph_10.map | 2 +- inherit_graph_10.md5 | 2 +- inherit_graph_10.svg | 12 +- inherit_graph_11.map | 2 +- inherit_graph_11.md5 | 2 +- inherit_graph_11.svg | 12 +- inherit_graph_12.map | 2 +- inherit_graph_12.md5 | 2 +- inherit_graph_12.svg | 12 +- inherit_graph_13.map | 2 +- inherit_graph_13.md5 | 2 +- inherit_graph_13.svg | 12 +- inherit_graph_14.map | 2 +- inherit_graph_14.md5 | 2 +- inherit_graph_14.svg | 12 +- inherit_graph_15.map | 2 +- inherit_graph_15.md5 | 2 +- inherit_graph_15.svg | 12 +- inherit_graph_16.map | 2 +- inherit_graph_16.md5 | 2 +- inherit_graph_16.svg | 12 +- inherit_graph_17.map | 2 +- inherit_graph_17.md5 | 2 +- inherit_graph_17.svg | 12 +- inherit_graph_18.map | 3 +- inherit_graph_18.md5 | 2 +- inherit_graph_18.svg | 27 +- inherit_graph_19.map | 3 +- inherit_graph_19.md5 | 2 +- inherit_graph_19.svg | 27 +- inherit_graph_20.map | 2 +- inherit_graph_20.md5 | 2 +- inherit_graph_20.svg | 15 +- inherit_graph_21.map | 2 +- inherit_graph_21.md5 | 2 +- inherit_graph_21.svg | 15 +- inherit_graph_22.map | 2 +- inherit_graph_22.md5 | 2 +- inherit_graph_22.svg | 12 +- inherit_graph_23.map | 2 +- inherit_graph_23.md5 | 2 +- inherit_graph_23.svg | 12 +- inherit_graph_24.map | 2 +- inherit_graph_24.md5 | 2 +- inherit_graph_24.svg | 12 +- inherit_graph_25.map | 2 +- inherit_graph_25.md5 | 2 +- inherit_graph_25.svg | 12 +- inherit_graph_26.map | 2 +- inherit_graph_26.md5 | 2 +- inherit_graph_26.svg | 12 +- inherit_graph_27.map | 2 +- inherit_graph_27.md5 | 2 +- inherit_graph_27.svg | 12 +- inherit_graph_28.map | 2 +- inherit_graph_28.md5 | 2 +- inherit_graph_28.svg | 12 +- inherit_graph_29.map | 2 +- inherit_graph_29.md5 | 2 +- inherit_graph_29.svg | 15 +- inherit_graph_30.map | 2 +- inherit_graph_30.md5 | 2 +- inherit_graph_30.svg | 12 +- inherit_graph_31.map | 2 +- inherit_graph_31.md5 | 2 +- inherit_graph_31.svg | 15 +- inherit_graph_32.map | 2 +- inherit_graph_32.md5 | 2 +- inherit_graph_32.svg | 12 +- inherit_graph_33.map | 2 +- inherit_graph_33.md5 | 2 +- inherit_graph_33.svg | 12 +- inherit_graph_34.map | 2 +- inherit_graph_34.md5 | 2 +- inherit_graph_34.svg | 12 +- inherit_graph_35.map | 2 +- inherit_graph_35.md5 | 2 +- inherit_graph_35.svg | 12 +- inherit_graph_36.map | 2 +- inherit_graph_36.md5 | 2 +- inherit_graph_36.svg | 10 +- inherit_graph_37.map | 2 +- inherit_graph_37.md5 | 2 +- inherit_graph_37.svg | 15 +- inherit_graph_38.map | 2 +- inherit_graph_38.md5 | 2 +- inherit_graph_38.svg | 15 +- inherit_graph_39.map | 2 +- inherit_graph_39.md5 | 2 +- inherit_graph_39.svg | 15 +- inherit_graph_40.map | 2 +- inherit_graph_40.md5 | 2 +- inherit_graph_40.svg | 15 +- inherit_graph_41.map | 2 +- inherit_graph_41.md5 | 2 +- inherit_graph_41.svg | 12 +- inherit_graph_42.map | 2 +- inherit_graph_42.md5 | 2 +- inherit_graph_42.svg | 12 +- inherit_graph_43.map | 2 +- inherit_graph_43.md5 | 2 +- inherit_graph_43.svg | 12 +- inherit_graph_9.map | 2 +- inherit_graph_9.md5 | 2 +- inherit_graph_9.svg | 15 +- inherits.html | 70 +-- namespacemembers.html | 6 +- namespacemembers_func.html | 6 +- namespaces.html | 39 +- namespaces_dup.js | 1 + navtreedata.js | 60 +-- navtreeindex0.js | 92 ++-- navtreeindex1.js | 48 +- navtreeindex2.js | 70 +-- navtreeindex3.js | 26 +- navtreeindex4.js | 30 +- navtreeindex5.js | 56 +- navtreeindex6.js | 25 +- search/all_10.js | 138 ++--- search/all_11.js | 238 ++++----- search/all_12.js | 44 +- search/all_13.js | 229 ++++---- search/all_14.js | 496 +++++++++--------- search/all_15.js | 220 ++++---- search/all_16.js | 128 ++--- search/all_17.js | 92 ++-- search/all_18.js | 170 +++--- search/all_19.js | 12 +- search/all_1a.js | 8 +- search/all_1b.js | 6 +- search/all_1c.js | 186 +++---- search/all_2.js | 91 ++-- search/all_3.js | 174 +++--- search/all_4.js | 234 ++++----- search/all_5.js | 232 ++++---- search/all_6.js | 138 ++--- search/all_7.js | 254 ++++----- search/all_8.js | 156 +++--- search/all_9.js | 88 ++-- search/all_a.js | 378 ++++++------- search/all_b.js | 16 +- search/all_c.js | 36 +- search/all_d.js | 164 +++--- search/all_e.js | 256 ++++----- search/all_f.js | 146 +++--- search/classes_0.js | 41 +- search/classes_1.js | 78 +-- search/classes_10.js | 6 +- search/classes_11.js | 80 +-- search/classes_12.js | 96 ++-- search/classes_13.js | 46 +- search/classes_14.js | 64 +-- search/classes_15.js | 38 +- search/classes_16.js | 62 +-- search/classes_17.js | 4 +- search/classes_18.js | 2 +- search/classes_2.js | 70 +-- search/classes_3.js | 32 +- search/classes_4.js | 34 +- search/classes_5.js | 34 +- search/classes_6.js | 12 +- search/classes_7.js | 18 +- search/classes_8.js | 196 +++---- search/classes_9.js | 2 +- search/classes_a.js | 4 +- search/classes_b.js | 36 +- search/classes_c.js | 76 +-- search/classes_d.js | 36 +- search/classes_e.js | 24 +- search/classes_f.js | 34 +- search/defines_0.js | 4 +- search/defines_1.js | 4 +- search/defines_2.js | 4 +- search/defines_3.js | 2 +- search/defines_4.js | 4 +- search/defines_5.js | 4 +- search/defines_6.js | 4 +- search/files_0.js | 2 +- search/files_1.js | 8 +- search/files_10.js | 26 +- search/files_11.js | 15 +- search/files_12.js | 10 +- search/files_13.js | 36 +- search/files_14.js | 10 +- search/files_15.js | 6 +- search/files_16.js | 4 +- search/files_17.js | 2 +- search/files_2.js | 26 +- search/files_3.js | 22 +- search/files_4.js | 18 +- search/files_5.js | 6 +- search/files_6.js | 20 +- search/files_7.js | 16 +- search/files_8.js | 16 +- search/files_9.js | 8 +- search/files_a.js | 6 +- search/files_b.js | 10 +- search/files_c.js | 26 +- search/files_d.js | 20 +- search/files_e.js | 14 +- search/files_f.js | 8 +- search/functions_0.js | 6 +- search/functions_1.js | 162 +++--- search/functions_10.js | 168 +++--- search/functions_11.js | 18 +- search/functions_12.js | 162 +++--- search/functions_13.js | 380 +++++++------- search/functions_14.js | 164 +++--- search/functions_15.js | 84 +-- search/functions_16.js | 46 +- search/functions_17.js | 150 +++--- search/functions_18.js | 6 +- search/functions_19.js | 2 +- search/functions_1a.js | 4 +- search/functions_1b.js | 186 +++---- search/functions_2.js | 122 ++--- search/functions_3.js | 164 +++--- search/functions_4.js | 190 +++---- search/functions_5.js | 114 ++-- search/functions_6.js | 210 ++++---- search/functions_7.js | 130 ++--- search/functions_8.js | 44 +- search/functions_9.js | 190 +++---- search/functions_a.js | 6 +- search/functions_b.js | 18 +- search/functions_c.js | 102 ++-- search/functions_d.js | 176 +++---- search/functions_e.js | 102 ++-- search/functions_f.js | 116 ++-- search/groups_0.js | 2 +- search/groups_1.js | 4 +- search/groups_2.js | 2 +- search/namespaces_0.js | 2 +- search/namespaces_1.js | 2 +- search/namespaces_10.js | 8 +- search/namespaces_11.js | 30 +- search/namespaces_12.js | 2 +- search/namespaces_13.js | 2 +- search/namespaces_14.js | 4 +- search/namespaces_15.js | 2 +- search/namespaces_2.js | 8 +- search/namespaces_3.js | 6 +- search/namespaces_4.js | 4 +- search/namespaces_5.js | 6 +- search/namespaces_6.js | 4 +- search/namespaces_7.js | 2 +- search/namespaces_8.js | 2 +- search/namespaces_9.js | 4 +- search/namespaces_a.js | 8 +- search/namespaces_b.js | 12 +- search/namespaces_c.js | 10 +- search/namespaces_d.js | 2 +- search/namespaces_e.js | 6 +- search/namespaces_f.js | 5 +- search/pages_0.js | 4 +- search/pages_1.js | 2 +- search/pages_2.js | 2 +- search/pages_3.js | 2 +- search/pages_4.js | 4 +- search/related_0.js | 10 +- search/typedefs_0.js | 2 +- search/typedefs_1.js | 2 +- search/typedefs_2.js | 2 +- search/variables_0.js | 4 +- search/variables_1.js | 10 +- search/variables_10.js | 20 +- search/variables_11.js | 2 +- search/variables_12.js | 4 +- search/variables_13.js | 2 +- search/variables_14.js | 2 +- search/variables_15.js | 2 +- search/variables_2.js | 2 +- search/variables_3.js | 4 +- search/variables_4.js | 4 +- search/variables_5.js | 9 +- search/variables_6.js | 16 +- search/variables_7.js | 4 +- search/variables_8.js | 2 +- search/variables_9.js | 6 +- search/variables_a.js | 13 +- search/variables_b.js | 8 +- search/variables_c.js | 16 +- search/variables_d.js | 4 +- search/variables_e.js | 3 +- search/variables_f.js | 18 +- 342 files changed, 6382 insertions(+), 5442 deletions(-) delete mode 100644 d0/dd2/class_queue___array.js create mode 100644 d1/d6d/queue__using__array_8cpp__incl.map create mode 100644 d1/d6d/queue__using__array_8cpp__incl.md5 create mode 100644 d1/d6d/queue__using__array_8cpp__incl.svg create mode 100644 d6/d04/classdata__structures_1_1queue__using__array_1_1_queue___array.html create mode 100644 d6/d04/classdata__structures_1_1queue__using__array_1_1_queue___array.js create mode 100644 d6/d04/classdata__structures_1_1queue__using__array_1_1_queue___array_a2aaf88c9954ef3ab686f8e4bfbd87622_cgraph.map create mode 100644 d6/d04/classdata__structures_1_1queue__using__array_1_1_queue___array_a2aaf88c9954ef3ab686f8e4bfbd87622_cgraph.md5 create mode 100644 d6/d04/classdata__structures_1_1queue__using__array_1_1_queue___array_a2aaf88c9954ef3ab686f8e4bfbd87622_cgraph.svg create mode 100644 d6/d04/classdata__structures_1_1queue__using__array_1_1_queue___array_a4dc64488c36f84d927365fa8d1933663_cgraph.map create mode 100644 d6/d04/classdata__structures_1_1queue__using__array_1_1_queue___array_a4dc64488c36f84d927365fa8d1933663_cgraph.md5 create mode 100644 d6/d04/classdata__structures_1_1queue__using__array_1_1_queue___array_a4dc64488c36f84d927365fa8d1933663_cgraph.svg create mode 100644 d6/d04/classdata__structures_1_1queue__using__array_1_1_queue___array_a688b7ea064739ea9fa66bf64bf4ae631_cgraph.map create mode 100644 d6/d04/classdata__structures_1_1queue__using__array_1_1_queue___array_a688b7ea064739ea9fa66bf64bf4ae631_cgraph.md5 create mode 100644 d6/d04/classdata__structures_1_1queue__using__array_1_1_queue___array_a688b7ea064739ea9fa66bf64bf4ae631_cgraph.svg rename de/d91/class_queue___array-members.html => d8/dba/classdata__structures_1_1queue__using__array_1_1_queue___array-members.html (59%) create mode 100644 d8/df0/queue__using__array_8cpp.html create mode 100644 d8/df0/queue__using__array_8cpp.js create mode 100644 d8/df0/queue__using__array_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 d8/df0/queue__using__array_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 d8/df0/queue__using__array_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg rename d0/dd2/class_queue___array.html => d9/d70/namespacequeue__using__array.html (52%) create mode 100644 db/d0f/classdata__structures_1_1queue__using__array_1_1_queue___array__coll__graph.map create mode 100644 db/d0f/classdata__structures_1_1queue__using__array_1_1_queue___array__coll__graph.md5 create mode 100644 db/d0f/classdata__structures_1_1queue__using__array_1_1_queue___array__coll__graph.svg diff --git a/annotated.html b/annotated.html index 6e5f576e9..0af19919d 100644 --- a/annotated.html +++ b/annotated.html @@ -102,9 +102,11 @@ $(document).ready(function(){initNavTree('annotated.html',''); initResizable();
a-z a-z Implementation of Hopcroft–Karp algorithm.
The Hopcroft–Karp algorithm is an algorithm that takes as input a bipartite graph and produces as output a maximum cardinality matching, it runs in O(E√V) time in worst case.
-A bipartite graph (or bigraph) is a graph whose vertices can be divided into two disjoint and independent sets U and V such that every edge connects a vertex in U to one in V. Vertex sets U and V are usually called the parts of the graph. Equivalently, a bipartite graph is a graph that does not contain any odd-length cycles.
-Given a matching M, edges that are part of matching are called Matching edges and edges that are not part of M (or connect free nodes) are called Not-Matching edges.
-Given a bipartite graphs G = ( V = ( X , Y ) , E ) whose partition has the parts X and Y, with E denoting the edges of the graph, the goal is to find a matching with as many edges as possible. Equivalently, a matching that covers as many vertices as possible.
-Given a matching M, an augmenting path is an alternating path that starts from and ends on free vertices. All single edge paths that start and end with free vertices are augmenting paths.
-A matching M is not maximum if there exists an augmenting path. It is also true other way, i.e, a matching is maximum if no augmenting path exists.
-1) Initialize the Maximal Matching M as empty. 2) While there exists an Augmenting Path P Remove matching edges of P from M and add not-matching edges of P to M (This increases size of M by 1 as P starts and ends with a free vertex i.e. a node that is not part of matching.) 3) Return M.
diff --git a/d4/d8d/jarvis__algorithm_8cpp.html b/d4/d8d/jarvis__algorithm_8cpp.html index 8b3655039..08f8ae1fb 100644 --- a/d4/d8d/jarvis__algorithm_8cpp.html +++ b/d4/d8d/jarvis__algorithm_8cpp.html @@ -137,7 +137,7 @@ FunctionsImplementation of Jarvis’s algorithm.
Given a set of points in the plane. the convex hull of the set is the smallest convex polygon that contains all the points of it.
-The idea of Jarvis’s Algorithm is simple, we start from the leftmost point (or point with minimum x coordinate value) and we keep wrapping points in counterclockwise direction.
The idea is to use orientation() here. Next point is selected as the point that beats all other points at counterclockwise orientation, i.e., next point is q if for any other point r, we have “orientation(p, q, r) = counterclockwise”.
diff --git a/d5/d33/gram__schmidt_8cpp.html b/d5/d33/gram__schmidt_8cpp.html index fd2297e32..3bfc24c7e 100644 --- a/d5/d33/gram__schmidt_8cpp.html +++ b/d5/d33/gram__schmidt_8cpp.html @@ -141,7 +141,7 @@ Functions
Takes the input of Linearly Independent Vectors, returns vectors orthogonal to each other.
-Take the first vector of given LI vectors as first vector of Orthogonal vectors. Take projection of second input vector on the first vector of Orthogonal vector and subtract it from the 2nd LI vector. Take projection of third vector on the second vector of Othogonal vectors and subtract it from the 3rd LI vector. Keep repeating the above process until all the vectors in the given input array are exhausted.
For Example: In R2, Input LI Vectors={(3,1),(2,2)} then Orthogonal Vectors= {(3, 1),(-0.4, 1.2)}
diff --git a/d5/d3c/namespacedata__structures.html b/d5/d3c/namespacedata__structures.html index 620a3ea12..de98f9aa3 100644 --- a/d5/d3c/namespacedata__structures.html +++ b/d5/d3c/namespacedata__structures.html @@ -124,7 +124,8 @@ constexpr floatData Structures algorithms.
-Data-structure algorithms.
+Data-structure algorithms.
+Algorithms with data structures.
Implementation of Bogosort algorithm
In computer science, bogosort (also known as permutation sort, stupid sort, slowsort, shotgun sort, random sort, monkey sort, bobosort or shuffle sort) is a highly inefficient sorting algorithm based on the generate and test paradigm. Two versions of this algorithm exist: a deterministic version that enumerates all permutations until it hits a sorted one, and a randomized version that randomly permutes its input.Randomized version is implemented here.
-Shuffle the array untill array is sorted.
diff --git a/d6/d04/classdata__structures_1_1queue__using__array_1_1_queue___array.html b/d6/d04/classdata__structures_1_1queue__using__array_1_1_queue___array.html new file mode 100644 index 000000000..c17b251e0 --- /dev/null +++ b/d6/d04/classdata__structures_1_1queue__using__array_1_1_queue___array.html @@ -0,0 +1,279 @@ + + + + + + + +|
+ Algorithms_in_C++
+ 1.0.0
+
+ Set of algorithms implemented in C++.
+ |
+
Queue_Array class containing the main data and also index of head and tail of the array. + More...
++Public Member Functions | |
| void | enqueue (const int16_t &) |
| Add element to the first of the queue. More... | |
| int | dequeue () |
| Delete element from back of the queue. More... | |
| void | display () const |
| Show all saved data. More... | |
+Private Attributes | |
| +int8_t | front {-1} |
| Index of head of the array. | |
| +int8_t | rear {-1} |
| Index of tail of the array. | |
| +std::array< int16_t, max_size > | arr |
| All stored data. | |
Queue_Array class containing the main data and also index of head and tail of the array.
+| int data_structures::queue_using_array::Queue_Array::dequeue | +( | +) | ++ |
Delete element from back of the queue.
+Remove element that is located at the first of the queue.
+| void data_structures::queue_using_array::Queue_Array::display | +( | +) | +const | +
Show all saved data.
+Utility function to show all elements in the queue.
+| void data_structures::queue_using_array::Queue_Array::enqueue | +( | +const int16_t & | +ele | ) | ++ |
Add element to the first of the queue.
+Adds new element to the end of the queue.
+| ele | to be added to the end of the queue |
Implementation of cutting a rod problem.
Given a rod of length n inches and an array of prices that contains prices of all pieces of size<=n. Determine the maximum profit obtainable by cutting up the rod and selling the pieces.
-The idea is to break the given rod into every smaller piece as possible and then check profit for each piece, by calculating maximum profit for smaller pieces we will build the solution for larger pieces in bottom-up manner.
|
+ Algorithms_in_C++
+ 1.0.0
+
+ Set of algorithms implemented in C++.
+ |
+
Implementation of Linear Queue using array. +More...
+#include <iostream>#include <array>+Classes | |
| class | data_structures::queue_using_array::Queue_Array |
| Queue_Array class containing the main data and also index of head and tail of the array. More... | |
+Namespaces | |
| data_structures | |
| Data Structures algorithms. | |
| queue_using_array | |
| Functions for Queue using Array implementation. | |
+Functions | |
| int | main () |
| Main function. More... | |
+Variables | |
| constexpr uint16_t | max_size {10} |
| for std::array More... | |
Implementation of Linear Queue using array.
+The Linear Queue is a data structure used for holding a sequence of values, which can be added to the end line (enqueue), removed from head of line (dequeue) and displayed.
+Values can be added by increasing the rear variable by 1 (which points to the end of the array), then assigning new value to rear's element of the array.
Values can be removed by increasing the front variable by 1 (which points to the first of the array), so it cannot reached any more.
| int main | +( | +void | +) | ++ |
Main function.
+Allows the user to add and delete values from the queue. Also allows user to display values in the queue.
+
|
+ +constexpr | +
for std::array
+for io operations Maximum size of the queue
+ +-Public Member Functions | |
| -void | enqueue (int) |
| -int | dequeue () |
| -void | display () |
-Public Attributes | |
| -int * | arr = new int[size] |
-Private Attributes | |
| -int | front |
| -int | rear |
| -int | size |
Functions for Queue using Array implementation. +More...
+Functions for Queue using Array implementation.
+Implementation of 0-1 Knapsack Problem
Given weights and values of n items, put these items in a knapsack of capacity W to get the maximum total value in the knapsack. In other words, given two integer arrays val[0..n-1] and wt[0..n-1] which represent values and weights associated with n items respectively. Also given an integer W which represents knapsack capacity, find out the maximum value subset of val[] such that sum of the weights of this subset is smaller than or equal to W. You cannot break an item, either pick the complete item or don’t pick it (0-1 property)
The idea is to consider all subsets of items and calculate the total weight and value of all subsets. Consider the only subsets whose total weight is smaller than W. From all such subsets, pick the maximum value subset.
The repository is a collection of open-source implementation of a variety of algorithms implemented in C++ and licensed under MIT License. The algorithms span a variety of topics from computer science, mathematics and statistics, data science, machine learning, engineering, etc.. The implementations and the associated documentation are meant to provide a learning resource for educators and students. Hence, one may find more than one implementation for the same objective but using a different algorithm strategies and optimizations.
-Online Documentation is generated from the repository source codes directly. The documentation contains all resources including source code snippets, details on execution of the programs, diagrammatic representation of program flow, and links to external resources where necessary. The documentation also introduces interactive source code with links to documentation for C++ STL library functions used. Click on Files menu to see the list of all the files documented with the code.
Documentation of Algorithms in C++ by The Algorithms Contributors is licensed under CC BY-SA 4.0
As a community developed and maintained repository, we welcome new un-plagiarized quality contributions. Please read our Contribution Guidelines.