Given an undirected tree, how can I find out those vertices which when taken as the root of the tree will minimize the depth of the tree. Similarly, I want to find those vertices which when taken as the root of tree, will maximize the depth of tree. I want to answer this for a general tree in linear time. (Linear in the number of vertices of the tree)
↧