From 7e9f4857e2facea9bd015c36372838fe71cfb92a Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Fri, 15 Oct 2021 16:44:16 +0000 Subject: [PATCH] Documentation for 95ed72a45275da29096e3bc1da83ae72fa98c4a9 --- annotated.html | 66 +-- annotated_dup.js | 2 + classes.html | 4 +- d1/d9a/hopcroft__karp_8cpp.html | 12 +- d1/ded/windowed__median_8cpp.html | 2 +- d2/d26/count__inversions_8cpp.html | 2 +- d3/db3/lru__cache_8cpp.html | 6 +- d3/df9/recursive__bubble__sort_8cpp.html | 2 +- d4/d2f/fcfs__scheduling_8cpp__incl.map | 12 + d4/d2f/fcfs__scheduling_8cpp__incl.md5 | 1 + d4/d2f/fcfs__scheduling_8cpp__incl.svg | 246 +++++++++ d4/d2f/fcfs__scheduling_8cpp__incl_org.svg | 158 ++++++ d4/d32/inorder__successor__of__bst_8cpp.html | 8 +- d4/d38/power__of__two_8cpp.html | 2 +- d4/d8d/jarvis__algorithm_8cpp.html | 2 +- d4/d9f/selection__sort__recursive_8cpp.html | 2 +- d5/d33/gram__schmidt_8cpp.html | 2 +- d5/d45/sublist__search_8cpp.html | 4 +- d5/d88/md__d_i_r_e_c_t_o_r_y.html | 41 +- d5/d96/md5_8cpp.html | 2 +- d5/ddb/bogo__sort_8cpp.html | 2 +- d6/d10/cut__rod_8cpp.html | 2 +- d7/d73/abbreviation_8cpp.html | 2 +- d8/d7a/sha1_8cpp.html | 2 +- d8/d90/iterative__tree__traversals_8cpp.html | 6 +- ...connected__components__with__dsu_8cpp.html | 2 +- d8/dc8/class_compare-members.html | 109 ++++ d9/dfd/comb__sort_8cpp.html | 2 +- da/d52/minimum__edit__distance_8cpp.html | 2 +- db/d16/0__1__knapsack_8cpp.html | 2 +- db/dca/kadane2_8cpp.html | 2 +- dd/d47/namespacemath.html | 2 +- dd/dca/class_f_c_f_s.html | 376 +++++++++++++ dd/dca/class_f_c_f_s.js | 7 + ...fbfe4d85f7576b4a7aade07d29fbd69_cgraph.map | 6 + ...fbfe4d85f7576b4a7aade07d29fbd69_cgraph.md5 | 1 + ...fbfe4d85f7576b4a7aade07d29fbd69_cgraph.svg | 69 +++ ...b361a612b18bb189aa6d3c49288b793_cgraph.map | 6 + ...b361a612b18bb189aa6d3c49288b793_cgraph.md5 | 1 + ...b361a612b18bb189aa6d3c49288b793_cgraph.svg | 67 +++ de/d4a/class_compare.html | 195 +++++++ de/d4a/class_compare.js | 4 + de/d8d/class_f_c_f_s-members.html | 114 ++++ df/d47/fcfs__scheduling_8cpp.html | 376 +++++++++++++ df/d47/fcfs__scheduling_8cpp.js | 9 + ...8dca7b867074164d5f45b0f3851269d_cgraph.map | 8 + ...8dca7b867074164d5f45b0f3851269d_cgraph.md5 | 1 + ...8dca7b867074164d5f45b0f3851269d_cgraph.svg | 99 ++++ ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map | 9 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 | 1 + ...66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg | 114 ++++ df/d66/vector__cross__product_8cpp.html | 2 +- ...0002_000016.html => dir_000002_000017.html | 0 dir_4d6e05837bf820fb089a8a8cdf2f42b7_dep.map | 2 +- dir_4d6e05837bf820fb089a8a8cdf2f42b7_dep.md5 | 2 +- dir_4d6e05837bf820fb089a8a8cdf2f42b7_dep.svg | 2 +- dir_cc8e79ed9d2b7756c78e8d0c87c6c0c7.html | 113 ++++ dir_cc8e79ed9d2b7756c78e8d0c87c6c0c7.js | 4 + files.html | 454 +++++++-------- files_dup.js | 1 + functions_a.html | 1 + functions_func_a.html | 1 + functions_func_i.html | 2 +- functions_func_o.html | 2 +- functions_func_p.html | 1 + functions_func_s.html | 1 + functions_i.html | 2 +- functions_o.html | 2 +- functions_p.html | 1 + functions_s.html | 2 + functions_vars.html | 1 + globals_func_g.html | 1 + globals_func_i.html | 2 +- globals_func_m.html | 2 +- globals_func_s.html | 3 +- globals_func_t.html | 2 +- globals_g.html | 1 + globals_i.html | 4 +- globals_m.html | 2 +- globals_p.html | 2 +- globals_s.html | 3 +- globals_t.html | 2 +- hierarchy.html | 174 +++--- hierarchy.js | 2 + index.html | 8 +- inherit_graph_10.map | 2 +- inherit_graph_10.md5 | 2 +- inherit_graph_10.svg | 4 +- inherit_graph_11.map | 2 +- inherit_graph_11.md5 | 2 +- inherit_graph_11.svg | 4 +- inherit_graph_12.map | 2 +- inherit_graph_12.md5 | 2 +- inherit_graph_12.svg | 14 +- inherit_graph_13.map | 2 +- inherit_graph_13.md5 | 2 +- inherit_graph_13.svg | 15 +- inherit_graph_14.map | 2 +- inherit_graph_14.md5 | 2 +- inherit_graph_14.svg | 15 +- inherit_graph_15.map | 2 +- inherit_graph_15.md5 | 2 +- inherit_graph_15.svg | 15 +- inherit_graph_16.map | 2 +- inherit_graph_16.md5 | 2 +- inherit_graph_16.svg | 15 +- inherit_graph_17.map | 2 +- inherit_graph_17.md5 | 2 +- inherit_graph_17.svg | 14 +- inherit_graph_18.map | 2 +- inherit_graph_18.md5 | 2 +- inherit_graph_18.svg | 4 +- inherit_graph_19.map | 2 +- inherit_graph_19.md5 | 2 +- inherit_graph_19.svg | 15 +- 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 | 12 +- inherit_graph_22.map | 2 +- inherit_graph_22.md5 | 2 +- inherit_graph_22.svg | 15 +- 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 | 3 +- inherit_graph_29.md5 | 2 +- inherit_graph_29.svg | 27 +- inherit_graph_30.map | 2 +- inherit_graph_30.md5 | 2 +- inherit_graph_30.svg | 12 +- inherit_graph_31.map | 3 +- inherit_graph_31.md5 | 2 +- inherit_graph_31.svg | 30 +- 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 | 15 +- 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 | 12 +- inherit_graph_37.map | 2 +- inherit_graph_37.md5 | 2 +- inherit_graph_37.svg | 12 +- inherit_graph_38.map | 2 +- inherit_graph_38.md5 | 2 +- inherit_graph_38.svg | 12 +- inherit_graph_39.map | 2 +- inherit_graph_39.md5 | 2 +- inherit_graph_39.svg | 12 +- inherit_graph_40.map | 2 +- inherit_graph_40.md5 | 2 +- inherit_graph_40.svg | 16 +- inherit_graph_41.map | 2 +- inherit_graph_41.md5 | 2 +- inherit_graph_41.svg | 16 +- inherit_graph_42.map | 2 +- inherit_graph_42.md5 | 2 +- inherit_graph_42.svg | 4 +- inherit_graph_43.map | 2 +- inherit_graph_43.md5 | 2 +- inherit_graph_43.svg | 17 +- inherit_graph_44.map | 2 +- inherit_graph_44.md5 | 2 +- inherit_graph_44.svg | 17 +- inherit_graph_45.map | 2 +- inherit_graph_45.md5 | 2 +- inherit_graph_45.svg | 14 +- inherit_graph_46.map | 2 +- inherit_graph_46.md5 | 2 +- inherit_graph_46.svg | 14 +- inherit_graph_47.map | 2 +- inherit_graph_47.md5 | 2 +- inherit_graph_47.svg | 15 +- inherit_graph_48.map | 2 +- inherit_graph_48.md5 | 2 +- inherit_graph_48.svg | 15 +- inherit_graph_49.map | 2 +- inherit_graph_49.md5 | 2 +- inherit_graph_49.svg | 12 +- inherit_graph_50.map | 2 +- inherit_graph_50.md5 | 2 +- inherit_graph_50.svg | 12 +- inherit_graph_51.map | 2 +- inherit_graph_51.md5 | 2 +- inherit_graph_51.svg | 12 +- inherit_graph_52.map | 2 +- inherit_graph_52.md5 | 2 +- inherit_graph_52.svg | 15 +- inherit_graph_53.map | 2 +- inherit_graph_53.md5 | 2 +- inherit_graph_53.svg | 15 +- inherit_graph_54.map | 2 +- inherit_graph_54.md5 | 2 +- inherit_graph_54.svg | 14 +- inherit_graph_55.map | 2 +- inherit_graph_55.md5 | 2 +- inherit_graph_55.svg | 14 +- inherit_graph_56.map | 2 +- inherit_graph_56.md5 | 2 +- inherit_graph_56.svg | 14 +- inherit_graph_57.map | 2 +- inherit_graph_57.md5 | 2 +- inherit_graph_57.svg | 14 +- inherit_graph_58.map | 2 +- inherit_graph_58.md5 | 2 +- inherit_graph_58.svg | 15 +- inherit_graph_59.map | 2 +- inherit_graph_59.md5 | 2 +- inherit_graph_59.svg | 14 +- inherit_graph_60.map | 2 +- inherit_graph_60.md5 | 2 +- inherit_graph_60.svg | 15 +- inherit_graph_61.map | 2 +- inherit_graph_61.md5 | 2 +- inherit_graph_61.svg | 14 +- inherit_graph_62.map | 2 +- inherit_graph_62.md5 | 2 +- inherit_graph_62.svg | 15 +- inherit_graph_63.map | 2 +- inherit_graph_63.md5 | 2 +- inherit_graph_63.svg | 15 +- inherit_graph_64.map | 2 +- inherit_graph_64.md5 | 2 +- inherit_graph_64.svg | 12 +- inherit_graph_65.map | 4 +- inherit_graph_65.md5 | 2 +- inherit_graph_65.svg | 50 +- inherit_graph_66.map | 2 +- inherit_graph_66.md5 | 2 +- inherit_graph_66.svg | 12 +- inherit_graph_67.map | 4 +- inherit_graph_67.md5 | 2 +- inherit_graph_67.svg | 51 +- inherit_graph_68.map | 2 +- inherit_graph_68.md5 | 2 +- inherit_graph_68.svg | 12 +- inherit_graph_69.map | 2 +- inherit_graph_69.md5 | 2 +- inherit_graph_69.svg | 14 +- inherit_graph_7.map | 2 +- inherit_graph_7.md5 | 2 +- inherit_graph_7.svg | 12 +- inherit_graph_70.map | 2 +- inherit_graph_70.md5 | 2 +- inherit_graph_70.svg | 12 +- inherit_graph_71.map | 2 +- inherit_graph_71.md5 | 2 +- inherit_graph_71.svg | 15 +- inherit_graph_72.map | 2 +- inherit_graph_72.md5 | 2 +- inherit_graph_72.svg | 12 +- inherit_graph_73.map | 2 +- inherit_graph_73.md5 | 2 +- inherit_graph_73.svg | 12 +- inherit_graph_74.map | 2 +- inherit_graph_74.md5 | 2 +- inherit_graph_74.svg | 12 +- inherit_graph_75.map | 2 +- inherit_graph_75.md5 | 2 +- inherit_graph_75.svg | 12 +- inherit_graph_76.map | 8 +- inherit_graph_76.md5 | 2 +- inherit_graph_76.svg | 106 +--- inherit_graph_77.map | 2 +- inherit_graph_77.md5 | 2 +- inherit_graph_77.svg | 12 +- inherit_graph_78.map | 8 +- inherit_graph_78.md5 | 2 +- inherit_graph_78.svg | 106 +++- inherit_graph_79.map | 2 +- inherit_graph_79.md5 | 2 +- inherit_graph_79.svg | 12 +- inherit_graph_8.map | 2 +- inherit_graph_8.md5 | 2 +- inherit_graph_8.svg | 12 +- inherit_graph_80.map | 2 +- inherit_graph_80.md5 | 2 +- inherit_graph_80.svg | 12 +- inherit_graph_81.map | 2 +- inherit_graph_81.md5 | 2 +- inherit_graph_81.svg | 12 +- inherit_graph_82.map | 2 +- inherit_graph_82.md5 | 2 +- inherit_graph_82.svg | 12 +- inherit_graph_83.map | 3 + inherit_graph_83.md5 | 1 + inherit_graph_83.svg | 22 + inherit_graph_84.map | 3 + inherit_graph_84.md5 | 1 + inherit_graph_84.svg | 22 + inherit_graph_9.map | 2 +- inherit_graph_9.md5 | 2 +- inherit_graph_9.svg | 15 +- inherits.html | 148 ++--- namespacemembers.html | 2 +- namespacemembers_func.html | 2 +- navtreedata.js | 58 +- navtreeindex0.js | 74 +-- navtreeindex1.js | 28 +- navtreeindex10.js | 418 +++++++------- navtreeindex11.js | 254 ++++----- navtreeindex12.js | 310 +++++------ navtreeindex13.js | 204 +++---- navtreeindex14.js | 15 + navtreeindex2.js | 246 ++++----- navtreeindex3.js | 346 ++++++------ navtreeindex4.js | 250 ++++----- navtreeindex5.js | 284 +++++----- navtreeindex6.js | 220 ++++---- navtreeindex7.js | 280 +++++----- navtreeindex8.js | 252 ++++----- navtreeindex9.js | 250 ++++----- search/all_10.js | 18 +- search/all_11.js | 73 +-- search/all_13.js | 4 +- search/all_14.js | 521 +++++++++--------- search/all_15.js | 32 +- search/all_2.js | 167 +++--- search/all_4.js | 158 +++--- search/all_6.js | 4 +- search/all_7.js | 252 ++++----- search/all_8.js | 161 +++--- search/all_a.js | 405 +++++++------- search/all_e.js | 155 +++--- search/classes_2.js | 33 +- search/classes_5.js | 29 +- search/files_6.js | 19 +- search/functions_1.js | 137 ++--- search/functions_10.js | 67 +-- search/functions_12.js | 87 ++- search/functions_13.js | 402 +++++++------- search/functions_14.js | 8 +- search/functions_3.js | 4 +- search/functions_5.js | 4 +- search/functions_7.js | 141 ++--- search/functions_9.js | 194 +++---- search/functions_d.js | 107 ++-- search/functions_f.js | 2 +- search/variables_11.js | 19 +- 365 files changed, 6848 insertions(+), 4620 deletions(-) create mode 100644 d4/d2f/fcfs__scheduling_8cpp__incl.map create mode 100644 d4/d2f/fcfs__scheduling_8cpp__incl.md5 create mode 100644 d4/d2f/fcfs__scheduling_8cpp__incl.svg create mode 100644 d4/d2f/fcfs__scheduling_8cpp__incl_org.svg create mode 100644 d8/dc8/class_compare-members.html create mode 100644 dd/dca/class_f_c_f_s.html create mode 100644 dd/dca/class_f_c_f_s.js create mode 100644 dd/dca/class_f_c_f_s_a8fbfe4d85f7576b4a7aade07d29fbd69_cgraph.map create mode 100644 dd/dca/class_f_c_f_s_a8fbfe4d85f7576b4a7aade07d29fbd69_cgraph.md5 create mode 100644 dd/dca/class_f_c_f_s_a8fbfe4d85f7576b4a7aade07d29fbd69_cgraph.svg create mode 100644 dd/dca/class_f_c_f_s_abb361a612b18bb189aa6d3c49288b793_cgraph.map create mode 100644 dd/dca/class_f_c_f_s_abb361a612b18bb189aa6d3c49288b793_cgraph.md5 create mode 100644 dd/dca/class_f_c_f_s_abb361a612b18bb189aa6d3c49288b793_cgraph.svg create mode 100644 de/d4a/class_compare.html create mode 100644 de/d4a/class_compare.js create mode 100644 de/d8d/class_f_c_f_s-members.html create mode 100644 df/d47/fcfs__scheduling_8cpp.html create mode 100644 df/d47/fcfs__scheduling_8cpp.js create mode 100644 df/d47/fcfs__scheduling_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.map create mode 100644 df/d47/fcfs__scheduling_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.md5 create mode 100644 df/d47/fcfs__scheduling_8cpp_aa8dca7b867074164d5f45b0f3851269d_cgraph.svg create mode 100644 df/d47/fcfs__scheduling_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.map create mode 100644 df/d47/fcfs__scheduling_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.md5 create mode 100644 df/d47/fcfs__scheduling_8cpp_ae66f6b31b5ad750f1fe042a706a4e3d4_cgraph.svg rename dir_000002_000016.html => dir_000002_000017.html (100%) create mode 100644 dir_cc8e79ed9d2b7756c78e8d0c87c6c0c7.html create mode 100644 dir_cc8e79ed9d2b7756c78e8d0c87c6c0c7.js create mode 100644 inherit_graph_83.map create mode 100644 inherit_graph_83.md5 create mode 100644 inherit_graph_83.svg create mode 100644 inherit_graph_84.map create mode 100644 inherit_graph_84.md5 create mode 100644 inherit_graph_84.svg create mode 100644 navtreeindex14.js diff --git a/annotated.html b/annotated.html index a6b318d20..87c850ea6 100644 --- a/annotated.html +++ b/annotated.html @@ -192,38 +192,40 @@ $(document).ready(function(){initNavTree('annotated.html',''); initResizable();
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/d1/ded/windowed__median_8cpp.html b/d1/ded/windowed__median_8cpp.html index dc3fcacb9..38150141d 100644 --- a/d1/ded/windowed__median_8cpp.html +++ b/d1/ded/windowed__median_8cpp.html @@ -150,7 +150,7 @@ FunctionsAn implementation of a median calculation of a sliding window along a data stream.
Given a stream of integers, the algorithm calculates the median of a fixed size window at the back of the stream. The leading time complexity of this algorithm is O(log(N), and it is inspired by the known algorithm to [find median from (infinite) data stream](https://www.tutorialcup.com/interview/algorithm/find-median-from-data-stream.htm), with the proper modifications to account for the finite window size for which the median is requested
-The sliding window is managed by a list, which guarantees O(1) for both pushing and popping. Each new value is pushed to the window back, while a value from the front of the window is popped. In addition, the algorithm manages a multi-value binary search tree (BST), implemented by std::multiset. For each new value that is inserted into the window, it is also inserted to the BST. When a value is popped from the window, it is also erased from the BST. Both insertion and erasion to/from the BST are O(logN) in time, with N the size of the window. Finally, the algorithm keeps a pointer to the root of the BST, and updates its position whenever values are inserted or erased to/from BST. The root of the tree is the median! Hence, median retrieval is always O(1)
Time complexity: O(logN). Space complexity: O(N). N - size of window
diff --git a/d2/d26/count__inversions_8cpp.html b/d2/d26/count__inversions_8cpp.html index a27e31079..e7f3ecfe8 100644 --- a/d2/d26/count__inversions_8cpp.html +++ b/d2/d26/count__inversions_8cpp.html @@ -151,7 +151,7 @@ Functionstwo elements a[i] and a[j] form an inversion if a[i] > a[j] and i < j
Time Complexity --> O(n.log n)
Space Complexity --> O(n) ; additional array temp[1..n]
An implementation of LRU Cache. Lru is a part of cache algorithms (also frequently called cache replacement algorithms or cache replacement policies).
-For a cache of page frame x:
Every time a requested page is not found in cache, that is a miss or page fault, and if the page is present in cache, then its a hit.
-The working principle of the Bubble sort algorithm.
Bubble sort is a simple sorting algorithm used to rearrange a set of ascending or descending order elements. Bubble sort gets its name from the fact that data "bubbles" to the top of the dataset.
-What is Swap?
Swapping two numbers means that we interchange their values. Often, an additional variable is required for this operation. This is further illustrated in the following:
diff --git a/d4/d2f/fcfs__scheduling_8cpp__incl.map b/d4/d2f/fcfs__scheduling_8cpp__incl.map new file mode 100644 index 000000000..3158f721e --- /dev/null +++ b/d4/d2f/fcfs__scheduling_8cpp__incl.map @@ -0,0 +1,12 @@ + diff --git a/d4/d2f/fcfs__scheduling_8cpp__incl.md5 b/d4/d2f/fcfs__scheduling_8cpp__incl.md5 new file mode 100644 index 000000000..6853309e3 --- /dev/null +++ b/d4/d2f/fcfs__scheduling_8cpp__incl.md5 @@ -0,0 +1 @@ +0324174599ed13b0486f31d316384e99 \ No newline at end of file diff --git a/d4/d2f/fcfs__scheduling_8cpp__incl.svg b/d4/d2f/fcfs__scheduling_8cpp__incl.svg new file mode 100644 index 000000000..2f013e6d9 --- /dev/null +++ b/d4/d2f/fcfs__scheduling_8cpp__incl.svg @@ -0,0 +1,246 @@ + + + + + + diff --git a/d4/d2f/fcfs__scheduling_8cpp__incl_org.svg b/d4/d2f/fcfs__scheduling_8cpp__incl_org.svg new file mode 100644 index 000000000..bd2095678 --- /dev/null +++ b/d4/d2f/fcfs__scheduling_8cpp__incl_org.svg @@ -0,0 +1,158 @@ + + + + +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.
-* In this case, the left-most deepest node in the right subtree will
come just after the given node as we go to left deep in inorder.
Implementation to check whether a number is a power of 2 or not.
This algorithm uses bit manipulation to check if a number is a power of 2 or not.
-Let the input number be n, then the bitwise and between n and n-1 will let us know whether the number is power of 2 or not
For Example, If N= 32 then N-1 is 31, if we perform bitwise and of these two numbers then the result will be zero, which indicates that it is the power of 2 If N=23 then N-1 is 22, if we perform bitwise and of these two numbers then the result will not be zero , which indicates that it is not the power of 2
Implementation 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/d4/d9f/selection__sort__recursive_8cpp.html b/d4/d9f/selection__sort__recursive_8cpp.html index 69ee52e4e..1f12431b3 100644 --- a/d4/d9f/selection__sort__recursive_8cpp.html +++ b/d4/d9f/selection__sort__recursive_8cpp.html @@ -139,7 +139,7 @@ FunctionsImplementation of the Selection sort implementation using recursion.
The selection sort algorithm divides the input list into two parts: a sorted sublist of items which is built up from left to right at the front (left) of the list, and a sublist of the remaining unsorted items that occupy the rest of the list. Initially, the sorted sublist is empty, and the unsorted sublist is the entire input list. The algorithm proceeds by finding the smallest (or largest, depending on the sorting order) element in the unsorted sublist, exchanging (swapping) it with the leftmost unsorted element (putting it in sorted order), and moving the sublist boundaries one element to the right.
-FindMinIndex This function finds the minimum element of the array(list) recursively by simply comparing the minimum element of array reduced size by 1 and compares it to the last element of the array to find the minimum of the whole array.
SelectionSortRecursive Just like selection sort, it divides the list into two parts (i.e.: sorted and unsorted) and finds the minimum of the unsorted array. By calling the FindMinIndex function, it swaps the minimum element with the first element of the list, and then solves recursively for the remaining unsorted list.
Gram Schmidt Orthogonalisation Process
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/d45/sublist__search_8cpp.html b/d5/d45/sublist__search_8cpp.html index 2d629b439..201817fd1 100644 --- a/d5/d45/sublist__search_8cpp.html +++ b/d5/d45/sublist__search_8cpp.html @@ -148,14 +148,14 @@ FunctionsImplementation of the Sublist Search Algorithm
-However MD5 has be know to be cryptographically weak for quite some time, yet it is still widely used. This weakness was exploited by the Flame Malware in 2012
-First of all, all values are expected to be in little endian. This is especially important when using part of the bytestring as an integer.
The first step of the algorithm is to pad the message for its length to be a multiple of 64 (bytes). This is done by first adding 0x80 (10000000) and then only zeroes until the last 8 bytes must be filled, where then the 64 bit size of the input will be added
diff --git a/d5/ddb/bogo__sort_8cpp.html b/d5/ddb/bogo__sort_8cpp.html index 5fca0b893..30e0a0c78 100644 --- a/d5/ddb/bogo__sort_8cpp.html +++ b/d5/ddb/bogo__sort_8cpp.html @@ -135,7 +135,7 @@ FunctionsImplementation 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/d10/cut__rod_8cpp.html b/d6/d10/cut__rod_8cpp.html index 5da32cc73..e6dad50c4 100644 --- a/d6/d10/cut__rod_8cpp.html +++ b/d6/d10/cut__rod_8cpp.html @@ -135,7 +135,7 @@ FunctionsImplementation 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.
a's lowercase letters.a.The idea is in the problem statement itself: iterate through characters of string a and b (for character indexes i and j respectively):
a[i] and b[j] are equal, then move to next positionSimple C++ implementation of the SHA-1 Hashing Algorithm
SHA-1 is a cryptographic hash function that was developped by the NSA 1995. SHA-1 is not considered secure since around 2010.
-The first step of the algorithm is to pad the message for its length to be a multiple of 64 (bytes). This is done by first adding 0x80 (10000000) and then only zeroes until the last 8 bytes must be filled, where then the 64 bit size of the input will be added
Once this is done, the algo breaks down this padded message into 64 bytes chunks. Each chunk is used for one round, a round breaks the chunk into 16 blocks of 4 bytes. These 16 blocks are then extended to 80 blocks using XOR operations on existing blocks (see code for more details). The algorithm will then update its 160-bit state (here represented used 5 32-bits integer) using partial hashes computed using special functions on the blocks previously built. Please take a look at the wikipedia article for more precision on these operations
Iterative version of Preorder, Postorder, and preorder Traversal of the Tree
-Create a Stack that will store the Node of Tree. Push the root node into the stack. Save the root into the variabe named as current, and pop and elemnt from the stack. Store the data of current into the result array, and start traversing from it. Push both the child node of the current node into the stack, first right child then left child. Repeat the same set of steps untill the Stack becomes empty. And return the result array as the preorder traversal of a tree.
-Create a Stack that will store the Node of Tree. Push the root node into the stack. Save the root into the variabe named as current, and pop and elemnt from the stack. Store the data of current into the result array, and start traversing from it. Push both the child node of the current node into the stack, first left child then right child. Repeat the same set of steps untill the Stack becomes empty. Now reverse the result array and then return it to the calling function as a postorder traversal of a tree.
-Create a Stack that will store the Node of Tree. Push the root node into the stack. Save the root into the variabe named as current. Now iterate and take the current to the extreme left of the tree by traversing only to its left. Pop the elemnt from the stack and assign it to the current. Store the data of current into the result array. Repeat the same set of steps until the Stack becomes empty or the current becomes NULL. And return the result array as the inorder traversal of a tree.
The Disjoint union is the technique to find connected component in graph efficiently.
-In Graph, if you have to find out the number of connected components, there are 2 options
|
+ Algorithms_in_C++ 1.0.0
+
+ Set of algorithms implemented in C++.
+ |
+
This is the complete list of members for Compare< S, T, E >, including all inherited members.
+| operator()(tuple< S, T, E, double, double, double > &t1, tuple< S, T, E, double, double, double > &t2) | Compare< S, T, E > | inline |
Initialize swapped as true to make sure that loop runs
Keep running until gap = 1 or none elements were swapped
Find next gap
-Compare all elements with current gap
+Compare all elements with current gap
Implementation of Minimum Edit Distance using Dynamic Programing.
Given two strings str1 & str2 and we have to calculate the minimum number of operations (Insert, Remove, Replace) required to convert str1 to str2.
-We will solve this problem using Naive recursion. But as we are approaching with a DP solution. So, we will take a DP array to store the solution of all sub-problems so that we don't have to perform recursion again and again. Now to solve the problem, We can traverse all characters from either right side of the strings or left side. Suppose we will do it from the right side. So, there are two possibilities for every pair of characters being traversed.
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.
a-z a-z This repository is a collection of open-source implementation of a variety of algorithms implemented in C++ and licensed under MIT License. These 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.