Quantcast
Channel: DFS for Graph search with generic data types - Code Review Stack Exchange
Browsing latest articles
Browse All 3 View Live

Answer by user1118321 for DFS for Graph search with generic data types

This is a good start on making a generic graph class not tied to a specific type. Your naming is reasonable. Here are some things I would do differently.Improving Depth-First SearchIf you want to keep...

View Article


Answer by rsy56640 for DFS for Graph search with generic data types

In dfs(), visited and flag is kind of weird, using stack to implement dfs is more better in my view.

View Article


DFS for Graph search with generic data types

This question is a follow up to this. I am learning Graph data structure and have implemented DFS and BFS in a way that it can handle data types other than int. These function try to search an end or...

View Article
Browsing latest articles
Browse All 3 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>