GL
GrindLens
PatternsSheetsPricingQuestions
  1. Home
  2. /Patterns
  3. /Union-Find / Disjoint Set
←All Patterns
GraphsEvidence Contributing

Union-Find / Disjoint Set

Maintain disjoint sets with union and find operations to detect connectivity or cycles as edges are processed.

Practice Problems: 4
Difficulty: 0 Easy·3 Medium·1 Hard

Core technique

Review the technique, then try the mapped problems below. The right approach depends on each problem's constraints.

  • Core Strategy: Maintain disjoint sets with union and find operations to detect connectivity or cycles as edges are processed.

Canonical Practice Problems

4 problems
1.Graph Valid TreeMedium
Solve on LeetCode↗
2.Number of Connected Components in an Undirected GraphMedium
Solve on LeetCode↗
3.Redundant ConnectionMedium
Solve on LeetCode↗
4.Swim in Rising WaterHard
Solve on LeetCode↗

Curated Sheets Containing This Pattern

NeetCode 150

4 problems

→

NeetCode All

4 problems

→

Blind 75

2 problems

→

Striver A2Z

1 problem

→

Related Algorithmic Patterns

Binary Search1 shared

Binary Search on the Answer

Graphs

BFS Shortest Path (Unweighted)

Graphs

Bounded-Hop Shortest Path (Bellman-Ford Style)

Graphs

Dijkstra's Shortest Path

Graphs

Flood Fill

GL
GrindLens

Precision pattern analytics and curated sheet tracking for algorithmic coding interview preparation.

Quick lookup:⌘Kor/

Platform

  • Patterns→
  • Sheets→
  • Pricing→

Community

  • Feedback
  • Report a bug
  • X
  • LinkedIn

© 2026 GrindLens. LeetCode is a trademark of LeetCode. GrindLens is an independent analytics platform and is not affiliated with or endorsed by LeetCode.

Terms of ServicePrivacy Policy