General Question
How do I find a minimum subtree?
Asked by steeveage (3)
October 12th, 2009
Given an n-ary tree T where each node has a value V, find the smallest subtree S that contains all values in a list L.
What’s the optimal solution to this? One way I can think of doing this is to do a tree traversal starting from the root to find all values of L and continue to do this for every subtree until it is no longer true. However this is O(n^2), I wonder if there is anything faster.
Observing members:
0
Composing members:
0
3 Answers
Answer this question
This question is in the General Section. Responses must be helpful and on-topic.
Have a question?
Ask Fluther!