* Add comprehensive doctests to disjoint_set.py
- Add doctests for make_set() function with basic initialization tests
- Add doctests for union_set() function with union operations and connected nodes
- Add doctests for find_set() function with path compression verification
- Add doctests for find_python_set() function with error handling
- Add doctests for test_disjoint_set() function with comprehensive example
- All doctests pass and follow project coding standards
- Improves test coverage for fundamental disjoint set data structure
Contributes to #9943
* from dataclasses import dataclass
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: Christian Clauss <cclauss@me.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Create alternate_disjoint_set.py
This code implements a disjoint set using Lists
with added heuristics for efficiency
Union by Rank Heuristic and Path Compression
* Update alternate_disjoint_set.py
Added typehints, doctests and some suggested variable name change
* Update alternate_disjoint_set.py
* Formatted with Black
* More formatting
* Formatting on line 28
* Error in Doctest
* Doctest Update in alternate disjoint set
* Fixed build error
* Fixed doctest
* Add disjoint set
* disjoint set: add doctest, make code more Pythonic
* disjoint set: replace x.p with x.parent
* disjoint set: add test and refercence