Algorithm Designa67_q3a_disjoint_set_check

Disjoint Set Check

402a8780-32ba-4617-a389-b11c6563974e.cppC++
1// Loading code...

Selected Submission

100 / 100
0.171s
5272 KB
GraphImplementation
Time Comp.
O(Q * (N + Q * ?(N)))
Space Comp.
O(N)
Readability
7/10

"The code implements the Disjoint Set Union (DSU) data structure to detect cycles and find the size of connected components. The core logic revolves around the `find` and `unite` operations, which are fundamental to DSU, making 'Graph' and 'Implementation' the most appropriate tags."

History

AttemptPoints Time
Try #171005/1/2025
Try #1605/1/2025
Try #15955/1/2025
Try #14954/4/2025
Try #13904/2/2025
Try #12954/2/2025
Try #11954/2/2025
Try #10954/2/2025
Try #91004/2/2025
Try #8104/2/2025
Try #7904/2/2025
Try #6954/2/2025
Try #5904/2/2025
Try #404/2/2025
Try #3654/2/2025
Try #2654/2/2025
Try #104/2/2025