Skip to content

Enhancing DisjointSetUnion data structure #4366

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Sep 10, 2023

Conversation

Manan-09
Copy link
Contributor

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized it.
  • All filenames are in PascalCase.
  • All functions and variable names follow Java naming conventions.
  • All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.

Done enhancing of DisjoinSetUnion data structure code, added comments , unit testcase and updated method name. Also updated package name to disjointsets -> disjointsetunion .
Screenshot 2023-09-10 at 5 56 30 PM

@Manan-09
Copy link
Contributor Author

Please help with this lint error , what I need to do ?

@@ -22,4 +22,4 @@
         this.data = data;
         parent = this; // Initially, a node is its own parent.
     }
-}+}
--- ./src/main/java/com/thealgorithms/datastructures/disjointsetunion/DisjointSetUnion.java	(original)
+++ ./src/main/java/com/thealgorithms/datastructures/disjointsetunion/DisjointSetUnion.java	(reformatted)
@@ -50,4 +50,4 @@
             nx.rank++;
         }
     }
-}+}

@BamaCharanChhandogi
Copy link
Member

BamaCharanChhandogi commented Sep 10, 2023

Please help with this lint error , what I need to do ?

@@ -22,4 +22,4 @@
         this.data = data;
         parent = this; // Initially, a node is its own parent.
     }
-}+}
--- ./src/main/java/com/thealgorithms/datastructures/disjointsetunion/DisjointSetUnion.java	(original)
+++ ./src/main/java/com/thealgorithms/datastructures/disjointsetunion/DisjointSetUnion.java	(reformatted)
@@ -50,4 +50,4 @@
             nx.rank++;
         }
     }
-}+}

You have to give the next line after the curly bracket.

@Manan-09
Copy link
Contributor Author

Thanks @BamaCharanChhandogi

Copy link
Member

@vil02 vil02 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some quick remarks form my side.

When I will find some nice test covering the missing lines, I will put it here know.

@Manan-09
Copy link
Contributor Author

Some quick remarks form my side.

When I will find some nice test covering the missing lines, I will put it here know.

Screenshot 2023-09-10 at 9 38 14 PM @vil02 Updated testcases, covering all if branches

@siriak siriak requested a review from vil02 September 10, 2023 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants