Finding the diameter of m-ary tree - C
问题 I have to analyze an m-ary tree in C - using namely BFS. There are some requirements I don't succeed to implement for a while: 1. Find the diameter of the tree. 2. Given two vertices in the tree - find the shortest simple path between them. As for 1 - I went through the topics in Stack - and have seen some implementations (not in C unfortunately) which are not very clear to me... Some way of calculating the diameter by using BFS twice, starting from a random vertex... I'm not sure if the