Graph Valid Tree Using Union Find

preview_player
Показать описание
Using union find we can solve leetcode 261, which is to figure out if a graph is a valid tree or not.

Helpful link for understanding a union find approach:
Рекомендации по теме
Комментарии
Автор

what of the case where a node is not connected and is standing alone? does that mean if the parents are not the same, then its invalid?

kjjvjup