I propose the addition of the Disjoint Set (Union-Find) algorithm implementation to enhance the project's algorithmic capabilities, especially for use cases involving dynamic connectivity, Kruskal’s algorithm, or similar applications.
Key Features of the Disjoint Set Algorithm:
Union by Rank/Size - Optimizes merging of sets based on size or rank.
Path Compression - Ensures faster lookups by flattening the structure of the tree during the find operation.
Operations - Efficient find and union functions, both of which run in nearly constant time (amortized inverse Ackermann time).
Suggested Changes:
Create a new file or folder named disjoint_set.py or union_find.py.
Implement the Disjoint Set class with:
find(x) function with path compression.
union(x, y) function with union by rank/size.
Add unit tests to verify correctness of the algorithm for various scenarios (e.g., handling isolated nodes, union of disjoint sets, etc.).
Is there an existing issue for this?
Feature Description
I propose the addition of the Disjoint Set (Union-Find) algorithm implementation to enhance the project's algorithmic capabilities, especially for use cases involving dynamic connectivity, Kruskal’s algorithm, or similar applications. Key Features of the Disjoint Set Algorithm:
Suggested Changes:
Potential Use Cases:
Record
Full Name
Venkata Pavan Teja Bathula
Participant Role
GSSOC