Task H3.5: Google interview question 14 points The diameter of a graph G = (V, E) is given by the maximum distance D :=
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Task H3.5: Google interview question 14 points The diameter of a graph G = (V, E) is given by the maximum distance D :=
question 14 points The diameter of a graph G = (V, E) is given by the maximum distance D := maxvev d(u, v) between any pair of vertices, where d(u, v) is the number of edges on a shortest path from u to v. Describe an algorithm that determines the diameter of a given tree T' in linear time. Use pseudocode to describe your algorithm. Prove correctness of your algorithm and show its running time.
Task H3.5: Google interview