Add comprehensive doctests to disjoint_set.py#13619
Open
faizan842 wants to merge 1 commit intoTheAlgorithms:masterfrom
Open
Add comprehensive doctests to disjoint_set.py#13619faizan842 wants to merge 1 commit intoTheAlgorithms:masterfrom
faizan842 wants to merge 1 commit intoTheAlgorithms:masterfrom
Conversation
- 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 TheAlgorithms#9943
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Added comprehensive doctests to the disjoint set data structure implementation.
Changes
data_structures/disjoint_set/disjoint_set.pyTesting
python -m doctest data_structures/disjoint_set/disjoint_set.py -vruff check data_structures/disjoint_set/disjoint_set.pyFunctions Enhanced
make_set(): Basic initialization and property verificationunion_set(): Union operations and connected node verificationfind_set(): Path compression and parent findingfind_python_set(): Error handling and set operationstest_disjoint_set(): Comprehensive integration testContributes to #9943