r/computerscience • • Apr 21 '25

Help Doubt in Dsa

Guys, while traversing a directed graph using BFS or DFS, some nodes may not be reachable. What should we do in that case? Is it okay to leave ?

28 Upvotes

8 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Apr 21 '25

F is reachable but E K G J are not reachable as you can see on the 2nd picture i have solved!

1

u/kiner_shah Apr 22 '25

Yes, they can be ignored, if you start your search from A, they can't be reached.