Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@
</scm>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven.compiler.release>17</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,18 @@
* @param <E> the type of elements in the Disjoint Set
*/
public class FullCompression<E> implements FindCompressStrategy<E> {
/**
* Creates a new FullCompression strategy.
*/
public FullCompression() {
}

Comment on lines +13 to 18
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

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

[nitpick] The explicit empty constructor provides no additional functionality beyond the default constructor. Consider removing it or adding a comment explaining why it's explicitly defined (e.g., for documentation purposes or future extension).

Suggested change
/**
* Creates a new FullCompression strategy.
*/
public FullCompression() {
}

Copilot uses AI. Check for mistakes.
/**
* Applies the full path compression strategy to find the root of the subset containing the specified element.
* If the element is not found in the map, an {@link IllegalArgumentException} is thrown.
*
* @param parentByElement the map representing the parent relationship of elements in the disjoint set
* @param element the element for which to find the root
* @param element the element for which to find the root
* @return the root of the subset containing the specified element
* @throws IllegalArgumentException if the element is not found in the disjoint set
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@
* @param <E> the type of elements in the Disjoint Set
*/
public class PathHalvingCompression<E> implements FindCompressStrategy<E> {
/**
* Creates a new PathHalvingCompression strategy.
*/
public PathHalvingCompression() {
}

Comment on lines +12 to 17
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

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

[nitpick] The explicit empty constructor provides no additional functionality beyond the default constructor. Consider removing it or adding a comment explaining why it's explicitly defined (e.g., for documentation purposes or future extension).

Suggested change
/**
* Creates a new PathHalvingCompression strategy.
*/
public PathHalvingCompression() {
}

Copilot uses AI. Check for mistakes.
/**
* Applies the path halving compression strategy to find the root of the subset containing the specified element.
* If the element is not found in the map, an {@link IllegalArgumentException} is thrown.
*
* @param parentByElement the map representing the parent relationship of elements in the disjoint set
* @param element the element for which to find the root
* @param element the element for which to find the root
* @return the root of the subset containing the specified element
* @throws IllegalArgumentException if the element is not found in the disjoint set
*/
Expand Down