You are given an unweighted, undirected tree. Write a program to find a vertex set of minimum size in this tree such that each edge has as least one of its end-points in that set.InputThe first line of the input file contains one integer N --- number of nodes in the tree (0 < N <= 100000). Next N-1 lines contain N-1 edges of that tree --- Each line contains a pair (u, v) means there is an edge between node u and node v (1 <= u,v <= N).OutputPrint number of nodes in the satisfied vertex set on one line.Example 1Input:31 21 3Output:1Explanation:The set can be {1}Example 2Input:31 22 3Output:1Explanation:The set can be {2}I solved it using recursion(top-down) apporach can it be solved using bottom-up manner?
Is problem PT07X on SPOJ can be solved using bottom-up approach DP?
dynamic programming