epatrizio / cds

Data structures in C language
The Unlicense
0 stars 0 forks source link

Graph DFS #14

Open epatrizio opened 2 years ago

epatrizio commented 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)

epatrizio commented 2 years ago

This approach is used in BFS algorithm with a queue.