DFS
DFS
#include <iostream>
#include <stack>
nodeStack.push(start);
visited[start] = true;
while (!nodeStack.empty()) {
int currentNode = nodeStack.top();
nodeStack.pop();
int main() {
int graph[MAX_NODES][MAX_NODES] = {0};
int numNodes, numEdges;
int startNode;
std::cout << "Enter the starXng node for DFS: ";
std::cin >> startNode;
std::cout << "DFS traversal starXng from node " << startNode << ":" << std::endl;
dfs(graph, startNode, numNodes);
return 0;
}