achyutb6 / diameter-of-tree-bfs

Diameter of a tree using breadth first search

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

diameter-of-tree-bfs

Implement the algorithm to find the diameter of a tree using the algorithm discussed in class, that runs BFS twice. Code this algorithm without modifying Graph.java and BFSOO.java, using them from package rbk.

int diameter(Graph g) { ... } // assume that g is an acyclic, connected graph (tree).

About

Diameter of a tree using breadth first search


Languages

Language:Java 100.0%