11class 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