
266 Design and Analysis of Algorithms
adding to T, at each stage of the iteration S
p
from S, such that it adds largest number of
elements from S, not already in T. Stop when
∪T
l
= ∪S
i
.
(i) Write an algorithm for sets containing
natural numbers. Analyse its time com-
plexity.
(ii) Show that the strategy suggested does
NOT necessarily lead to an optimal
solution.
(iii) Suppose the minimum cover is defi ned
in terms of the number of total elements
in T, Σ |Ti | for 1 ≤ i ≤ k being minimum.
Rewrite the algorithm and see if it al-
ways fi nds the minimum cover.
10.6 Show that if T is a spanning tree for the undi-
rected graph G, then the addition ...