diff --git a/annotated.html b/annotated.html index bae880eaa..e9c061d05 100644 --- a/annotated.html +++ b/annotated.html @@ -103,6 +103,7 @@ $(document).ready(function(){initNavTree('annotated.html',''); initResizable();  Nlinked_list  Clink  Clist + CNode  Nlist_array  ClistStructure of List with supporting methods  Nqueue_using_array @@ -201,12 +202,12 @@ $(document).ready(function(){initNavTree('annotated.html',''); initResizable();  CMinHeap  CMinHeapNode  Cmst - Cnode - CNode + CNode + Cnode  CPoint  Cquery - Cqueue - CQueue + CQueue + Cqueue  CRBtree  CSegmentIntersection  CSolution diff --git a/annotated_dup.js b/annotated_dup.js index fbd78f48f..99134395f 100644 --- a/annotated_dup.js +++ b/annotated_dup.js @@ -9,7 +9,8 @@ var annotated_dup = [ "data_structures", "d5/d3c/namespacedata__structures.html", [ [ "linked_list", null, [ [ "link", "de/d9d/classdata__structures_1_1linked__list_1_1link.html", "de/d9d/classdata__structures_1_1linked__list_1_1link" ], - [ "list", "d1/def/classdata__structures_1_1linked__list_1_1list.html", "d1/def/classdata__structures_1_1linked__list_1_1list" ] + [ "list", "d1/def/classdata__structures_1_1linked__list_1_1list.html", "d1/def/classdata__structures_1_1linked__list_1_1list" ], + [ "Node", "d4/d0e/classdata__structures_1_1linked__list_1_1_node.html", "d4/d0e/classdata__structures_1_1linked__list_1_1_node" ] ] ], [ "list_array", null, [ [ "list", "d5/dab/structdata__structures_1_1list__array_1_1list.html", "d5/dab/structdata__structures_1_1list__array_1_1list" ] @@ -136,12 +137,12 @@ var annotated_dup = [ "MinHeap", "d2/d05/class_min_heap.html", "d2/d05/class_min_heap" ], [ "MinHeapNode", "d5/d29/struct_min_heap_node.html", null ], [ "mst", "d1/d77/structmst.html", null ], - [ "node", "d5/da1/structnode.html", "d5/da1/structnode" ], [ "Node", "db/d8b/struct_node.html", null ], + [ "node", "d5/da1/structnode.html", "d5/da1/structnode" ], [ "Point", "d8/dc8/struct_point.html", "d8/dc8/struct_point" ], [ "query", "dd/d1b/structquery.html", null ], - [ "queue", "db/da9/classqueue.html", "db/da9/classqueue" ], [ "Queue", "dc/db5/struct_queue.html", null ], + [ "queue", "db/da9/classqueue.html", "db/da9/classqueue" ], [ "RBtree", "d8/d72/class_r_btree.html", null ], [ "SegmentIntersection", "d4/db4/struct_segment_intersection.html", "d4/db4/struct_segment_intersection" ], [ "Solution", "dd/d4f/class_solution.html", null ], diff --git a/classes.html b/classes.html index a2c37d9b6..1561c1557 100644 --- a/classes.html +++ b/classes.html @@ -130,13 +130,13 @@ $(document).ready(function(){initNavTree('classes.html',''); initResizable(); })
MinHeap
MinHeapNode
mst
N
-
NCRModuloP (math::ncr_modulo_p)
NeuralNetwork (machine_learning::neural_network)
Node (data_structures)
Node (data_structures::tree_234)
Trie::Node (data_structures::trie_using_hashmap)
node
Node
Node (operations_on_datastructures::inorder_traversal_of_bst)
Node (others::iterative_tree_traversals)
perSegTree::Node (range_queries)
Node (search::sublist_search)
+
NCRModuloP (math::ncr_modulo_p)
NeuralNetwork (machine_learning::neural_network)
Node (data_structures::linked_list)
Node (data_structures)
Node (data_structures::tree_234)
Trie::Node (data_structures::trie_using_hashmap)
Node
node
Node (operations_on_datastructures::inorder_traversal_of_bst)
Node (others::iterative_tree_traversals)
perSegTree::Node (range_queries)
Node (search::sublist_search)
P
perSegTree (range_queries)
Point (ciphers::elliptic_curve_key_exchange)
Point (geometry::jarvis)
Point
Q
-
query
queue
Queue
Queue_Array (data_structures::queue_using_array)
+
query
Queue
queue
Queue_Array (data_structures::queue_using_array)
R
RBtree
RootedTree (graph)
diff --git a/d0/d30/classdata__structures_1_1linked__list_1_1_node__coll__graph.map b/d0/d30/classdata__structures_1_1linked__list_1_1_node__coll__graph.map new file mode 100644 index 000000000..157d21d3a --- /dev/null +++ b/d0/d30/classdata__structures_1_1linked__list_1_1_node__coll__graph.map @@ -0,0 +1,3 @@ + + + diff --git a/d0/d30/classdata__structures_1_1linked__list_1_1_node__coll__graph.md5 b/d0/d30/classdata__structures_1_1linked__list_1_1_node__coll__graph.md5 new file mode 100644 index 000000000..b6f7a3521 --- /dev/null +++ b/d0/d30/classdata__structures_1_1linked__list_1_1_node__coll__graph.md5 @@ -0,0 +1 @@ +7f3ae73e1b0aedfcfafbe14acee6c016 \ No newline at end of file diff --git a/d0/d30/classdata__structures_1_1linked__list_1_1_node__coll__graph.svg b/d0/d30/classdata__structures_1_1linked__list_1_1_node__coll__graph.svg new file mode 100644 index 000000000..bfd3d801b --- /dev/null +++ b/d0/d30/classdata__structures_1_1linked__list_1_1_node__coll__graph.svg @@ -0,0 +1,30 @@ + + + + + + +data_structures::linked_list::Node + + + +Node1 + + +data_structures::linked +_list::Node + + + + + +Node1->Node1 + + + next + + + diff --git a/d1/d15/classdata__structures_1_1linked__list_1_1list__coll__graph.map b/d1/d15/classdata__structures_1_1linked__list_1_1list__coll__graph.map new file mode 100644 index 000000000..9cc4b0d86 --- /dev/null +++ b/d1/d15/classdata__structures_1_1linked__list_1_1list__coll__graph.map @@ -0,0 +1,4 @@ + + + + diff --git a/d1/d15/classdata__structures_1_1linked__list_1_1list__coll__graph.md5 b/d1/d15/classdata__structures_1_1linked__list_1_1list__coll__graph.md5 new file mode 100644 index 000000000..0b197e8e6 --- /dev/null +++ b/d1/d15/classdata__structures_1_1linked__list_1_1list__coll__graph.md5 @@ -0,0 +1 @@ +85368f38fcd85221d79e39a84ad2b9f8 \ No newline at end of file diff --git a/d1/d15/classdata__structures_1_1linked__list_1_1list__coll__graph.svg b/d1/d15/classdata__structures_1_1linked__list_1_1list__coll__graph.svg new file mode 100644 index 000000000..c775ee784 --- /dev/null +++ b/d1/d15/classdata__structures_1_1linked__list_1_1list__coll__graph.svg @@ -0,0 +1,47 @@ + + + + + + +data_structures::linked_list::list + + + +Node1 + + +data_structures::linked +_list::list + + + + + +Node2 + + +data_structures::linked +_list::Node + + + + + +Node2->Node1 + + + head + + + +Node2->Node2 + + + next + + + diff --git a/d1/d9a/hopcroft__karp_8cpp.html b/d1/d9a/hopcroft__karp_8cpp.html index 8637057b6..4f1c16fde 100644 --- a/d1/d9a/hopcroft__karp_8cpp.html +++ b/d1/d9a/hopcroft__karp_8cpp.html @@ -137,22 +137,22 @@ Functions

Detailed Description

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.

-

+

Bipartite graph

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.

-

+

Matching and Not-Matching edges

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.

-

+

Maximum cardinality matching

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.

-

+

Augmenting paths

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.

-

+

Concept

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.

-

+

Algorithm

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.

Author
Krishna Pal Deora
diff --git a/d1/def/classdata__structures_1_1linked__list_1_1list.html b/d1/def/classdata__structures_1_1linked__list_1_1list.html index 5349c6c8c..ceac35048 100644 --- a/d1/def/classdata__structures_1_1linked__list_1_1list.html +++ b/d1/def/classdata__structures_1_1linked__list_1_1list.html @@ -97,12 +97,19 @@ $(document).ready(function(){initNavTree('d1/def/classdata__structures_1_1linked
data_structures::linked_list::list Class Reference
+
+Collaboration diagram for data_structures::linked_list::list:
+
+
+
+
[legend]
+ @@ -117,6 +124,29 @@ Public Member Functions + + + + + + + + + + + + + + + + + + + +

Public Member Functions

 list ()
 
bool isEmpty ()
 Utility function that checks if the list is empty. More...
 
void push_back (int new_elem)
 
void reverse ()
 
 list ()
 
+bool isEmpty ()
 
void insert (int32_t new_elem)
 Utility function that adds a new element at the end of the list. More...
 
void reverseList ()
 Utility function for reversing a list. More...
 
+void display ()
 
int32_t top ()
 Utility function to find the top element of the list. More...
 
+int32_t last ()
 
int32_t traverse (int32_t index)
 Utility function to find the i th element of the list. More...
 
@@ -124,16 +154,18 @@ Private Attributesstd::shared_ptr< link >  - - - + + + + +

Private Attributes

first
 link before the actual first element
 
-std::shared_ptr< linklast
 last link on the list
 
std::shared_ptr< linklast
 last link on the list More...
 
+Nodehead
 

Detailed Description

A list class containing a sequence of links

Constructor & Destructor Documentation

-

◆ list()

+

◆ list() [1/2]

@@ -159,10 +191,39 @@ Private Attributes
90 // Initialize the first link
91 first = std::make_shared<link>();
92 // Initialize the last link with the first link
-
93 last = nullptr;
+
93 last = nullptr;
94 }
std::shared_ptr< link > first
link before the actual first element
Definition: linked_list.cpp:83
-
std::shared_ptr< link > last
last link on the list
Definition: linked_list.cpp:84
+
std::shared_ptr< link > last
last link on the list
Definition: linked_list.cpp:84
+
+
+
+ +

◆ list() [2/2]

+ +
+
+ + + + + +
+ + + + + + + +
data_structures::linked_list::list::list ()
+
+inline
+
+

List constructor. Initializes the first link.

+
59 {
+
60 head = nullptr; // Initialize the first link
+
61 }
@@ -194,7 +255,7 @@ Private Attributes
190 }
191}
std::cout
-
data_structures::linked_list::list::isEmpty
bool isEmpty()
Definition: linked_list.cpp:111
+
data_structures::linked_list::list::isEmpty
bool isEmpty()
Utility function that checks if the list is empty.
Definition: linked_list.cpp:111
std::shared_ptr
Here is the call graph for this function:
@@ -233,10 +294,10 @@ Here is the call graph for this function:
156 }
157 std::shared_ptr<link> t = first;
158 std::shared_ptr<link> to_be_removed = nullptr;
-
159 while (t != last && t->succ()->val() != old_elem) {
+
159 while (t != last && t->succ()->val() != old_elem) {
160 t = t->succ();
161 }
-
162 if (t == last) {
+
162 if (t == last) {
163 std::cout << "Element not found\n";
164 return;
165 }
@@ -244,10 +305,10 @@ Here is the call graph for this function:
167 t->succ() = t->succ()->succ();
168 to_be_removed.reset();
169 if (t->succ() == nullptr) {
-
170 last = t;
+
170 last = t;
171 }
-
172 if (first == last){
-
173 last = nullptr;
+
172 if (first == last){
+
173 last = nullptr;
174 }
175}
std::shared_ptr::reset
T reset(T... args)
@@ -258,6 +319,60 @@ Here is the call graph for this function: + + + +

◆ insert()

+ +
+
+ + + + + + + + +
void list::insert (int32_t n)
+
+ +

Utility function that adds a new element at the end of the list.

+
Parameters
+ + +
new_elemelement be added at the end of the list
+
+
+
82 {
+
83 try {
+
84 Node *new_node = new Node();
+
85 Node *temp = nullptr;
+
86 new_node->val = n;
+
87 new_node->next = nullptr;
+
88 if (isEmpty()) {
+
89 head = new_node;
+
90 } else {
+
91 temp = head;
+
92 while (temp->next != nullptr) {
+
93 temp = temp->next;
+
94 }
+
95 temp->next = new_node;
+
96 }
+
97 } catch (std::bad_alloc &exception) {
+
98 std::cerr << "bad_alloc detected: " << exception.what() << "\n";
+
99 }
+
100}
+ +
Definition: linkedlist_implentation_usingarray.cpp:14
+
T what(T... args)
+
+Here is the call graph for this function:
+
+
+
+
+
@@ -274,11 +389,17 @@ Here is the call graph for this function:
+ +

Utility function that checks if the list is empty.

function checks if list is empty

Returns
true if list is empty
-false if list is not empty
+false if list is not empty +
+true if the list is empty
+
+false if the list is not empty
111 {
-
112 if (last == nullptr) {
+
112 if (last == nullptr) {
113 return true;
114 } else {
115 return false;
@@ -311,10 +432,10 @@ false if list is not empty
123 {
124 if (isEmpty()) {
125 first->succ() = std::make_shared<link>(new_elem);
-
126 last = first->succ();
+
126 last = first->succ();
127 } else {
-
128 last->succ() = std::make_shared<link>(new_elem);
-
129 last = last->succ();
+
128 last->succ() = std::make_shared<link>(new_elem);
+
129 last = last->succ();
130 }
131}
@@ -350,7 +471,7 @@ Here is the call graph for this function:
137 {
138 if (isEmpty()) {
139 first->succ() = std::make_shared<link>(new_elem);
-
140 last = first->succ();
+
140 last = first->succ();
141 } else {
142 std::shared_ptr<link> t = std::make_shared<link>(new_elem);
143 t->succ() = first->succ();
@@ -364,6 +485,38 @@ Here is the call graph for this function:
+ + + +

◆ reverseList()

+ +
+
+ + + + + + + +
void list::reverseList ()
+
+ +

Utility function for reversing a list.

+

Using the current, previous, and next pointer.

Returns
void
+
107 {
+
108 Node *curr = head;
+
109 Node *prev = nullptr, *next_node = nullptr;
+
110 while (curr != nullptr) {
+
111 next_node = curr->next;
+
112 curr->next = prev;
+
113 prev = curr;
+
114 curr = next_node;
+
115 }
+
116 head = prev;
+
117}
+
T prev(T... args)
+
@@ -394,10 +547,10 @@ Here is the call graph for this function:
200 return nullptr;
201 }
202 std::shared_ptr<link> t = first;
-
203 while (t != last && t->succ()->val() != find_elem) {
+
203 while (t != last && t->succ()->val() != find_elem) {
204 t = t->succ();
205 }
-
206 if (t == last) {
+
206 if (t == last) {
207 std::cout << "Element not found\n";
208 return nullptr;
209 }
@@ -413,8 +566,109 @@ Here is the call graph for this function: -
The documentation for this class was generated from the following file: