Open epatrizio opened 2 years ago
For very big graphs, the recursive DFS algorithm can cause a stackoverflow. Refactoring : while loop without recursive calls -> use a stack (push / pop during vertices visit)
This approach is used in BFS algorithm with a queue.
For very big graphs, the recursive DFS algorithm can cause a stackoverflow. Refactoring : while loop without recursive calls -> use a stack (push / pop during vertices visit)