Skip to content

Commit 8deafe3

Browse files
authored
Update main.cpp
1 parent c15fb45 commit 8deafe3

File tree

1 file changed

+3
-3
lines changed
  • 23 - Graph Data Structure Problems/18 - Articulation Point in Graph

1 file changed

+3
-3
lines changed

23 - Graph Data Structure Problems/18 - Articulation Point in Graph/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
class Solution {
22
public:
33
// Depth First Search to find articulation points
4-
void DSF(int node, int parent, int& timer, vector<int>& disc, vector<int>& low, vector<int>& visited, vector<int>& AP, vector<vector<int>>& adjacencyList) {
4+
void DFS(int node, int parent, int& timer, vector<int>& disc, vector<int>& low, vector<int>& visited, vector<int>& AP, vector<vector<int>>& adjacencyList) {
55
visited[node] = true; // Mark the node as visited
66
disc[node] = low[node] = timer++; // Assign discovery time and initialize low
77
int child = 0; // Count of children in DFS tree
@@ -11,7 +11,7 @@ class Solution {
1111
if (neighbour == parent) continue; // Skip the parent node
1212

1313
if (!visited[neighbour]) { // If the neighbor is not visited
14-
DSF(neighbour, node, timer, disc, low, visited, AP, adjacencyList); // Recursively visit
14+
DFS(neighbour, node, timer, disc, low, visited, AP, adjacencyList); // Recursively visit
1515
low[node] = min(low[node], low[neighbour]); // Update low value for the current node
1616

1717
// Check articulation point condition
@@ -47,7 +47,7 @@ class Solution {
4747
// Perform DFS for all connected components
4848
for (int i = 0; i < V; i++) {
4949
if (!visited[i]) {
50-
DSF(i, -1, timer, disc, low, visited, AP, adjacencyList);
50+
DFS(i, -1, timer, disc, low, visited, AP, adjacencyList);
5151
}
5252
}
5353

0 commit comments

Comments
 (0)