Wrong Maximal Independent Set
CodeChefOpen on judge ↗
Consider a tree of N nodes. A maximal independent set of nodes of this tree is the maximal (by size) set S of nodes {v1, v2, ..., vm} such that for any i, j, where 1 ≤ i , it holds that the nodes vi and vj are not connected by an edge. Consider a following algorithm of finding the maximal independent set of nodes of a tree: - First, a permutation of N integers, each denoting a particular node,
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start