@@ -12,8 +12,8 @@ query if there already exists a path between 2 nodes.
12
12
13
13
Generally, there are 2 main operations:
14
14
15
- 1 . Union: Join two subsets into a single subset
16
- 2 . Find: Determine which subset a particular element is in. In practice, this is often done to check
15
+ 1 . ** Union** : Join two subsets into a single subset
16
+ 2 . ** Find** : Determine which subset a particular element is in. In practice, this is often done to check
17
17
if two elements are in the same subset or component.
18
18
19
19
The Disjoint Set structure is often introduced in 3 parts, with each iteration being better than the
@@ -27,12 +27,12 @@ Querying for connectivity and updating usually tracked with an internal array.
27
27
a balanced tree and hence complexity does not necessarily improve
28
28
- Note, this is not implemented but details can be found under weighted union folder.
29
29
30
- 3 . ** Weighted Union** - Same idea of using a tree, but constructed in a way that the tree is balanced, leading to improved
31
- complexities. Can be further augmented with path compression.
30
+ 3 . ** Weighted Union** - Same idea of using a tree, but constructed in a way that the tree is balanced, leading to
31
+ 4 . improved complexities. Can be further augmented with path compression.
32
32
33
33
## Applications
34
34
Because of its efficiency and simplicity in implementing, Disjoint Set structures are widely used in practice:
35
- 1 . As mentioned, it is often sued as a helper structure for Kruskal's MST algorithm
35
+ 1 . As mentioned, it is often used as a helper structure for Kruskal's MST algorithm
36
36
2 . It can be used in the context of network connectivity
37
37
- Managing a network of computers
38
38
- Or even analyse social networks, finding communities and determining if two users are connected through a chain
@@ -42,4 +42,4 @@ Because of its efficiency and simplicity in implementing, Disjoint Set structure
42
42
43
43
## Notes
44
44
Disjoint Set is a data structure designed to keep track of a set of elements partitioned into a number of
45
- non-overlapping subsets. It is not suited for handling duplicates and so our implementation ignores duplicates.
45
+ non-overlapping subsets. ** It is not suited for handling duplicates** and so our implementation ignores duplicates.
0 commit comments