Repository: TheAlgorithms/Java
Pull request #5430 (2024-08-29 19:45:18)

refactor: change packages
Change packages of few classes:

FordFulkerson is a graph algorithm.

KMP and RabinKarp, are string algorithms.

SieveOfEratosthenes and EulersFunction, are mathematical algorithms.

<!--
Thank you for your contribution!
In order to reduce the number of notifications sent to the maintainers, please:
- create your PR as draft, cf. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests#draft-pull-requests,
- make sure that all of the CI checks pass,
- mark your PR as ready for review, cf. https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/changing-the-stage-of-a-pull-request#marking-a-pull-request-as-ready-for-review
-->

<!-- For completed items, change [ ] to [x] -->

- [x] I have read [CONTRIBUTING.md](https://github.com/TheAlgorithms/Java/blob/master/CONTRIBUTING.md).
- [x] This pull request is all my own work -- I have not plagiarized it.
- [x] All filenames are in PascalCase.
- [x] All functions and variable names follow Java naming conventions.
- [x] All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.
- [x] All new code is formatted with `clang-format -i --style=file path/to/your/file.java`

codecov-commenter: ## [Codecov](https://app.codecov.io/gh/TheAlgorithms/Java/pull/5430?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TheAlgorithms) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 50.70%. Comparing base [(`c57e02d`)](https://app.codecov.io/gh/TheAlgorithms/Java/commit/c57e02dc856e61118d89609f34900ff6d4d0376c?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TheAlgorithms) to head [(`b47ff2f`)](https://app.codecov.io/gh/TheAlgorithms/Java/commit/b47ff2fdc5665a1118731ebb584a9fb42a9fcb7f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TheAlgorithms).

<details><summary>Additional details and impacted files</summary>


```diff
@@             Coverage Diff              @@
##             master    #5430      +/-   ##
============================================
- Coverage     50.71%   50.70%   -0.01%     
- Complexity     3136     3143       +7     
============================================
  Files           523      523              
  Lines         15128    15128              
  Branches       2880     2880              
============================================
- Hits           7672     7671       -1     
- Misses         7130     7131       +1     
  Partials        326      326              
```

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/TheAlgorithms/Java/pull/5430?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TheAlgorithms).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=TheAlgorithms).


Patch:
diff --git a/src/main/java/com/thealgorithms/dynamicprogramming/FordFulkerson.java b/src/main/java/com/thealgorithms/datastructures/graphs/FordFulkerson.java
similarity index 97%
rename from src/main/java/com/thealgorithms/dynamicprogramming/FordFulkerson.java
rename to src/main/java/com/thealgorithms/datastructures/graphs/FordFulkerson.java
index 76995f1c..af2665cf 100644
--- a/src/main/java/com/thealgorithms/dynamicprogramming/FordFulkerson.java
+++ b/src/main/java/com/thealgorithms/datastructures/graphs/FordFulkerson.java
@@ -1,4 +1,4 @@
-package com.thealgorithms.dynamicprogramming;
+package com.thealgorithms.datastructures.graphs;
 
 import java.util.LinkedList;
 import java.util.Queue;
diff --git a/src/main/java/com/thealgorithms/others/EulersFunction.java b/src/main/java/com/thealgorithms/maths/EulersFunction.java
similarity index 97%
rename from src/main/java/com/thealgorithms/others/EulersFunction.java
rename to src/main/java/com/thealgorithms/maths/EulersFunction.java
index 7a6f49d4..3a6bc875 100644
--- a/src/main/java/com/thealgorithms/others/EulersFunction.java
+++ b/src/main/java/com/thealgorithms/maths/EulersFunction.java
@@ -1,4 +1,4 @@
-package com.thealgorithms.others;
+package com.thealgorithms.maths;
 
 /**
  * Utility class for computing
diff --git a/src/main/java/com/thealgorithms/others/SieveOfEratosthenes.java b/src/main/java/com/thealgorithms/maths/SieveOfEratosthenes.java
similarity index 98%
rename from src/main/java/com/thealgorithms/others/SieveOfEratosthenes.java
rename to src/main/java/com/thealgorithms/maths/SieveOfEratosthenes.java
index 6a341250..f22d22e8 100644
--- a/src/main/java/com/thealgorithms/others/SieveOfEratosthenes.java
+++ b/src/main/java/com/thealgorithms/maths/SieveOfEratosthenes.java
@@ -1,4 +1,4 @@
-package com.thealgorithms.others;
+package com.thealgorithms.maths;
 
 import java.util.Arrays;
 
diff --git a/src/main/java/com/thealgorithms/others/KMP.java b/src/main/java/com/thealgorithms/strings/KMP.java
similarity index 97%
rename from src/main/java/com/thealgorithms/others/KMP.java
rename to src/main/java/com/thealgorithms/strings/KMP.java
index 73eaf2fc..07d3b041 100644
--- a/src/main/java/com/thealgorithms/others/KMP.java
+++ b/src/main/java/com/thealgorithms/strings/KMP.java
@@ -1,4 +1,4 @@
-package com.thealgorithms.others;
+package com.thealgorithms.strings;
 
 /**
  * Implementation of Knuth–Morris–Pratt algorithm Usage: see the main function
diff --git a/src/main/java/com/thealgorithms/others/RabinKarp.java b/src/main/java/com/thealgorithms/strings/RabinKarp.java
similarity index 98%
rename from src/main/java/com/thealgorithms/others/RabinKarp.java
rename to src/main/java/com/thealgorithms/strings/RabinKarp.java
index cecf24e0..bb8df335 100644
--- a/src/main/java/com/thealgorithms/others/RabinKarp.java
+++ b/src/main/java/com/thealgorithms/strings/RabinKarp.java
@@ -1,4 +1,4 @@
-package com.thealgorithms.others;
+package com.thealgorithms.strings;
 
 import java.util.Scanner;
 


Test patch:
diff --git a/src/main/java/com/thealgorithms/dynamicprogramming/ShortestCommonSupersequenceLength.java b/src/main/java/com/thealgorithms/dynamicprogramming/ShortestCommonSupersequenceLength.java
index 3ea440ca..56129dcd 100644
--- a/src/main/java/com/thealgorithms/dynamicprogramming/ShortestCommonSupersequenceLength.java
+++ b/src/main/java/com/thealgorithms/dynamicprogramming/ShortestCommonSupersequenceLength.java
@@ -5,8 +5,8 @@ package com.thealgorithms.dynamicprogramming;
  * supersequence of two given strings. The shortest supersequence is the smallest string
  * that contains both given strings as subsequences.
  */
-final class ShortestCommonSuperSequenceLength {
-    private ShortestCommonSuperSequenceLength() {
+final class ShortestCommonSupersequenceLength {
+    private ShortestCommonSupersequenceLength() {
     }
 
     /**
diff --git a/src/test/java/com/thealgorithms/dynamicprogramming/FordFulkersonTest.java b/src/test/java/com/thealgorithms/datastructures/graphs/FordFulkersonTest.java
similarity index 98%
rename from src/test/java/com/thealgorithms/dynamicprogramming/FordFulkersonTest.java
rename to src/test/java/com/thealgorithms/datastructures/graphs/FordFulkersonTest.java
index d4d38ed5..908296aa 100644
--- a/src/test/java/com/thealgorithms/dynamicprogramming/FordFulkersonTest.java
+++ b/src/test/java/com/thealgorithms/datastructures/graphs/FordFulkersonTest.java
@@ -1,4 +1,4 @@
-package com.thealgorithms.dynamicprogramming;
+package com.thealgorithms.datastructures.graphs;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 
diff --git a/src/test/java/com/thealgorithms/dynamicprogramming/ShortestCommonSuperSequenceLengthTest.java b/src/test/java/com/thealgorithms/dynamicprogramming/ShortestCommonSupersequenceLengthTest.java
similarity index 70%
rename from src/test/java/com/thealgorithms/dynamicprogramming/ShortestCommonSuperSequenceLengthTest.java
rename to src/test/java/com/thealgorithms/dynamicprogramming/ShortestCommonSupersequenceLengthTest.java
index 007e71e2..8f0fd79f 100644
--- a/src/test/java/com/thealgorithms/dynamicprogramming/ShortestCommonSuperSequenceLengthTest.java
+++ b/src/test/java/com/thealgorithms/dynamicprogramming/ShortestCommonSupersequenceLengthTest.java
@@ -5,10 +5,10 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.CsvSource;
 
-public class ShortestCommonSuperSequenceLengthTest {
+public class ShortestCommonSupersequenceLengthTest {
     @ParameterizedTest
     @CsvSource({"AGGTAB, GXTXAYB, 9", "ABC, ABC, 3", "ABC, DEF, 6", "'', ABC, 3", "ABCD, AB, 4", "ABC, BCD, 4", "A, B, 2"})
-    void testShortestSuperSequence(String input1, String input2, int expected) {
-        assertEquals(expected, ShortestCommonSuperSequenceLength.shortestSuperSequence(input1, input2));
+    void testShortestSupersequence(String input1, String input2, int expected) {
+        assertEquals(expected, ShortestCommonSupersequenceLength.shortestSuperSequence(input1, input2));
     }
 }
diff --git a/src/test/java/com/thealgorithms/others/EulersFunctionTest.java b/src/test/java/com/thealgorithms/maths/EulersFunctionTest.java
similarity index 97%
rename from src/test/java/com/thealgorithms/others/EulersFunctionTest.java
rename to src/test/java/com/thealgorithms/maths/EulersFunctionTest.java
index 655c67c8..9048a711 100644
--- a/src/test/java/com/thealgorithms/others/EulersFunctionTest.java
+++ b/src/test/java/com/thealgorithms/maths/EulersFunctionTest.java
@@ -1,4 +1,4 @@
-package com.thealgorithms.others;
+package com.thealgorithms.maths;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertThrows;
diff --git a/src/test/java/com/thealgorithms/others/SieveOfEratosthenesTest.java b/src/test/java/com/thealgorithms/maths/SieveOfEratosthenesTest.java
similarity index 98%
rename from src/test/java/com/thealgorithms/others/SieveOfEratosthenesTest.java
rename to src/test/java/com/thealgorithms/maths/SieveOfEratosthenesTest.java
index 207c5146..ebbd5df7 100644
--- a/src/test/java/com/thealgorithms/others/SieveOfEratosthenesTest.java
+++ b/src/test/java/com/thealgorithms/maths/SieveOfEratosthenesTest.java
@@ -1,4 +1,4 @@
-package com.thealgorithms.others;
+package com.thealgorithms.maths;
 
 import static org.junit.jupiter.api.Assertions.assertArrayEquals;
 import static org.junit.jupiter.api.Assertions.assertThrows;