✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.
Consider the following program
For i from 1 to n
Makeset(i)
For i from 1 to n-1
Union(i, i+1)
Assume that the disjoint sets data is implemented as disjoint trees with union by rank heuristic
What is the number of trees in the forest and the maximum height of a tree after executing this code?