Give an algorithm that accepts as input an undirected tree, and finds the length of the diameter of the tree. The diameter of the tree is the longest path in the tree.
Remarks: All the graphs here are without self loops and parallel or antiparallel edges. In all the algorithms, always explain their correctness and analyze their complexity. The complexity should be as small as possible. A correct algorithm with large complexity, may not get full credit. You are not allowed to write complete programs... Make it pseudocode