Quantcast
Channel: DFS for Graph search with generic data types - Code Review Stack Exchange
Browsing index pages (3 articles)

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


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


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
Browsing index pages (3 articles)


Latest Images