Union Find | Introduction | Graph Algorithm | Union Find Part 1

preview_player
Показать описание
A disjoint-set data structure, also called a union–find data structure or merge–find set, is a data structure that stores a collection of disjoint (non-overlapping) sets.

Part 1. Union Find

# Union Find

## Part 1. Union Find

## Part 2. LeetCode 547. Number of Provinces

## Part 3. LeetCode 684. Redundant Connection

## Part 4. LeetCode 2316. Count Unreachable Pairs of Nodes in an Undirected Graph

## Part 5. LeetCode 2685. Count the Number of Complete Components
Рекомендации по теме
Комментарии
Автор

At 3:15, the union function should be: void union(int x, int y) { parent[findParent(x)] = parent[findParent(y)] }. Similar errors in 4:45 and 10:45. The code provided in the github link is correct.

BaseCaseCode