|
1 | 1 | # Union Find Algorithm
|
2 | 2 |
|
3 | | -Union-Find Algorithm ( or Disjoint Set Data Structure ) is used to group together a number of elements ( not in any specific order ) in a set and check if two elements belong to same set or are from different sets. |
| 3 | +Union-Find ( or Disjoint Set Data Structure ) is used to group together a number of elements in a set and check if two elements belong to same set or are from different sets. This algorithm is used to solve the dynamic connectivity problem in Computer Science & Graph Theory. |
| 4 | + |
| 5 | +There are quite a few approaches designing a disjoint set data structure. |
| 6 | +1. With fast union, but slow find |
| 7 | +2. With fast find, but slow union |
| 8 | +3. With fast union and fast find ( by using path compression ) |
0 commit comments