// Recur for all the vertices adjacent to this vertex for (int small_index = 0; small_index < start_node->numNeighbors; small_index++) { // Get the unvisited lowest vertex ID for (int i = 0; i < start_node->numNeighbors; i++) { if (strcmp(temp,start_node->neighbors[i]->val) > 0 && !visited[i]) { strcpy(temp,start_node->neighbors[i]->val); small_index = i; } } dfs(start_node->neighbors[small_index], visited, values, numNodes); }
Done. Check out line 51-61 in traversal_DFS.c.
// Recur for all the vertices adjacent to this vertex for (int small_index = 0; small_index < start_node->numNeighbors; small_index++) { // Get the unvisited lowest vertex ID for (int i = 0; i < start_node->numNeighbors; i++) { if (strcmp(temp,start_node->neighbors[i]->val) > 0 && !visited[i]) { strcpy(temp,start_node->neighbors[i]->val); small_index = i; } } dfs(start_node->neighbors[small_index], visited, values, numNodes); }