- Do we use DSU approach for cycle detection only in case of edge list or we can use it in Adj. list also??
- Can we use bfs() or dfs() for cycle detection in case of edge list??
Doubt in cycle detection using DSU
edge list and Adj. List are the way to represent the graph
some algorithm are easy to implement in adjl List , some in edge list
you can convert AdjList to edge list and then use DSU for cycle detection
yes you can do that
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.