319d5143cc
refactor: cleanup DudeneyNumber
( #5156 )
2024-05-12 14:35:33 +05:30
cf6c87c35c
style: make SubsetCount
a proper utility ( #5153 )
2024-05-11 14:36:17 +00:00
d2ddec55e5
style: include NAB_NEEDLESS_BOOLEAN_CONSTANT_CONVERSION
( #5149 )
...
* style: use `assertFalse` and `assertTrue`
* style: include `NAB_NEEDLESS_BOOLEAN_CONSTANT_CONVERSION`
2024-05-08 22:41:46 +05:30
d3bb691f59
style: enable HideUtilityClassConstructor
in checkstyle ( #5147 )
2024-05-08 09:58:29 +03:00
bfb27eeb59
style: enable ArrayTypeStyle
in checkstyle ( #5145 )
2024-05-06 22:49:52 +03:00
414835db11
style: enable AvoidStarImport
in checkstyle ( #5141 )
2024-05-05 20:48:56 +02:00
5d00889291
fix: handle empty inputs in CircleSort
( #5121 )
...
* fix: handle empty inputs in `CircleSort`
* style: remove `main` method
2024-05-05 23:56:54 +05:30
dda3c9cb59
Refactor Levenshtein distance implementation ( #5138 )
...
* ref: refactor Levenshtein distance implementation
- Rewrite the original levenshtein distance implementation in functional style
- Add optimized version of levenshtein distance
* ref: make `LevenshteinDistance` class a proper utility
* ref: remove duplicated test data
* ref: update tests
---
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
2024-05-04 11:13:30 +02:00
de18d0df7e
style: enable EmptyStatement
( #5120 )
2024-04-26 22:39:03 +03:00
6de154d218
tests: add tests of Mode
( #5104 )
2024-04-26 06:40:01 +00:00
ac598e2b93
Remove unused import. ( #5113 )
...
Co-authored-by: Maria Paszkiewicz SCC <maria.paszkiewicz@kit.edu>
2024-04-21 21:02:32 +02:00
8129686e2e
Added tests for FactorialRecursion
( #5109 )
...
* Added tests for `FactorialRecursion`
* Apply suggestions from code review
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
---------
Co-authored-by: Maria Paszkiewicz SCC <maria.paszkiewicz@kit.edu>
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
2024-04-20 20:31:13 +02:00
7201dc78ad
Added tests for NumberOfDigits ( #5107 )
...
Co-authored-by: Maria Paszkiewicz SCC <maria.paszkiewicz@kit.edu>
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
2024-04-13 20:45:07 +02:00
c53f178308
Implement Parentheses Generator ( #5096 )
...
* chore: add `ParenthesesGenerator` to `DIRECTORY.md`
* feat: implement Parentheses Generator
* ref: change `ParenthesesGenerator`s method to `static`
* ref: use parametrized tests
* ref: handling exception when `n < 0`
* chore: update docstrings
* ref: make `ParenthesesGenerator` to be a proper utility
* chore(docs): add private constructor docstring
* ref(tests): move bad name suggestions
* style: remove reduntant comments
---------
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
2024-04-05 18:41:27 +02:00
098f044370
Remove CalculateMaxOfMin
( #5079 )
2024-03-22 19:18:08 +08:00
47a9b1b647
Add WelshPowell
(Graph Colouring) ( #5034 )
...
* Welsh Powell Algorithm + Test
---------
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
2024-02-12 20:48:07 +01:00
14b3f45f9f
Add ExchangeSort
( #5029 )
...
* added ExchangeSort and its testcases
---------
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
2024-02-01 09:25:31 +01:00
55f08cc013
Add tests SumOfSubset
( #5021 )
...
* Updated main and test
* removed
* style: reorder test cases
---------
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
2024-01-26 19:30:26 +01:00
ac7152d757
Remove unused imports from PerfectSquareTest
( #5016 )
...
style: remove unused imports from `PerfectSquareTest`
2024-01-13 09:21:57 +00:00
9426053f73
Remove unused import from PowerOfTwoOrNotTest
( #5015 )
...
style: remove unused import from `PowerOfTwoOrNotTest.java`
2024-01-13 14:34:32 +05:30
8804cec957
Feature/4638 array right rotation ( #5014 )
...
* Create ArrayRightRotationTest.java
* Create ArrayRightRotation.java
* The updated one
* The updated one
* Added the test cases
* Added new test cases!
* Update ArrayRightRotation.java
* Update ArrayRightRotationTest.java
2024-01-13 13:59:30 +05:30
19b7a22ec9
Remove unused imports from BoyerMooreTest
( #5012 )
2024-01-10 20:31:38 +02:00
fd84b0b10e
Add SRTF Algorithm ( #5011 )
2024-01-08 23:48:11 +02:00
570f7e7ef6
Remove unused import ( #5010 )
2024-01-08 23:44:32 +02:00
bb2fff0cbb
Add package name ( #5007 )
2024-01-08 15:41:14 +02:00
0c881e39f2
Simplify minimizing lateness ( #4999 )
2024-01-08 15:34:36 +02:00
8930ab5b16
Cleanup SumOfDigits
and its tests ( #4994 )
2024-01-05 23:05:52 +02:00
1ea95ffa92
Cleanup PerfectSquare
and its tests ( #4992 )
2024-01-04 12:56:48 +02:00
092ac5795b
Remove SetKthBit
in favor of SingleBitOperations.setBit
( #4991 )
2024-01-04 00:28:59 +02:00
6a0c0585e4
Add cross-correlation and auto-correlation ( #4984 )
2024-01-03 20:11:07 +02:00
9bef5a169c
Add Playfair Cipher ( #4988 )
2024-01-03 15:14:38 +02:00
a7d140a43e
Add Set Kth Bit ( #4990 )
2024-01-02 20:18:01 +02:00
7ece806cf5
Remove duplicate file of Simple Substitution Cipher ( fixes #4494 ) ( #4495 )
2023-12-26 00:24:28 +02:00
e26fd9da71
Add OR-Set (Observed-Remove Set) ( #4980 )
2023-12-11 23:05:43 +02:00
4aa8e6a0eb
Updated TwoPSet to use Generics instead of Strings ( #4981 )
2023-12-11 20:58:56 +02:00
b8b1dea38d
Add LWW Element Set (Last Write Wins Element Set) ( #4979 )
2023-12-08 20:57:07 +02:00
92131de377
Fix compare() for subset check (S.A ⊆ T.A) ( #4978 )
2023-12-07 18:06:56 +02:00
249ee1dc99
Add 2P-Set (Two-Phase Set) for both addition and removal operations in distributed systems ( #4977 )
2023-12-07 17:23:22 +02:00
e59a3b1ebb
Add G-Set (Grow-only Set) ( #4975 )
2023-12-05 20:39:18 +02:00
3001620c1e
Add PN-Counter ( #4974 )
2023-12-04 18:22:02 +02:00
e759544c33
Add Boruvka's algorithm to find Minimum Spanning Tree ( #4964 )
2023-12-02 19:53:17 +02:00
1518e84fb9
Add Tribonacci Numbers ( fixes #4646 ) ( #4959 )
2023-11-26 13:34:13 +02:00
b1efd4e34b
Add G-Counter (Grow-only Counter) ( #4965 )
2023-11-24 19:13:44 +02:00
574138c7a3
Cleanup BoyerMoore
( #4951 )
...
* modify code to make use of java Optional class
* revert changes
* add java.util.Optional<Integer>
* add java.util.Optional
* refactors: make `findmajor` return `optional`
* refactors: make method name findMajor and split it
* refactors: change method name in tests
* Apply suggestions from code review
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
* change back to int
* fix: swap arguments
* tests: add some test cases
* refactor: add `isMajority` and avoid rounding
* style: use `var`
* style: swap arguments of `countOccurrences`
---------
Co-authored-by: vil02 <vil02@o2.pl>
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
2023-10-31 09:07:59 +01:00
945e7b56bb
Fix:/Number of count of major element in Boyer Moore algorithm ( #4728 )
...
* Number of count of major element in Boyer Moore algorithm
* test: add `BoyerMooreTest`
* style: basic linting
* tests: add test case from the issue
---------
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
Co-authored-by: vil02 <vil02@o2.pl>
2023-10-30 18:24:23 +01:00
9dde8a7808
Add MatrixRank
( #4571 )
...
* feat: adding matrix rank algorithm
* fix: formatting
* fix: adding comments, refactor and handling edge cases
* refactor: minor refactor
* enhancement: check matrix validity
* refactor: minor refactor and fixes
* Update src/main/java/com/thealgorithms/maths/MatrixRank.java
* feat: add unit test to check if input matrix is not modified while calculating the rank
---------
Co-authored-by: Anup Omkar <anup_omkar@intuit.com>
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
Co-authored-by: Andrii Siriak <siryaka@gmail.com>
2023-10-25 15:34:05 +02:00
a4711d61d8
Added MapReduce Algorithm in Misc Folder. ( #4828 )
...
* Added MapReduce Algorithm in Misc Folder.
* Did formatting correctly
* Removed main function and added MapReduceTest
* format the code
2023-10-25 09:30:18 +05:30
9dae389faa
Herons : Changed the signature of the function ( #4686 )
...
* Made changes to the code to correct the Logic of Armstrong Number
* Resolved the issues
* Trying to resolve the Linter error by changing Variable name
* Changed Variable Names : trying to resolve Clang error
* Chnged the signature of the function
* Added the Function documentation
* Added exception for parameters
* Resolved with suggested changes
* Resolved with Suggested changes
* fix: use proper logic
---------
Co-authored-by: vil02 <vil02@o2.pl>
2023-10-23 23:09:42 +02:00
48ae88f09d
Bit swap ( #4770 )
...
* Create BitSwap.java
* Create BitSwapTest.java
* Update BitSwap.java
* Update BitSwap.java
* Update BitSwapTest.java
* Update BitSwap.java
* Update BitSwap.java
* Update BitSwapTest.java
* Update BitSwapTest.java
* Update src/main/java/com/thealgorithms/bitmanipulation/BitSwap.java
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
* Update src/test/java/com/thealgorithms/bitmanipulation/BitSwapTest.java
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
* Update BitSwap.java
* Update BitSwap.java
* Update BitSwap.java
* Update src/main/java/com/thealgorithms/bitmanipulation/BitSwap.java
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
* Update src/main/java/com/thealgorithms/bitmanipulation/BitSwap.java
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
* Update src/test/java/com/thealgorithms/bitmanipulation/BitSwapTest.java
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
* style: remove redundant blank line
---------
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
2023-10-15 07:03:25 +00:00
24a8223062
Added [FEATURE REQUEST] Golden Ration formula to find Nth Fibonacci number #4505 ( #4513 )
...
* Create FibonacciNumber.java
* Update FibonacciNumber.java
* Update FibonacciNumber.java
* Update src/main/java/com/thealgorithms/maths/FibonacciNumber.java
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
* Update src/main/java/com/thealgorithms/maths/FibonacciNumber.java
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
* Update FibonacciNumber.java
* Update FibonacciNumber.java
* Update FibonacciNumber.java
* Update FibonacciNumber.java
* Create FibonacciNumberTest.java
* Update FibonacciNumberTest.java
* Update FibonacciNumberTest.java
* Update FibonacciNumberTest.java
* Update FibonacciNumberTest.java
* Update FibonacciNumberTest.java
* Update FibonacciNumberTest.java
* Update FibonacciNumberTest.java
* Update FibonacciNumberTest.java
* Update FibonacciNumberTest.java
* Update FibonacciNumberTest.java
* Update FibonacciNumberTest.java
* Update FibonacciNumberTest.java
* Update FibonacciNumberTest.java
* Update FibonacciNumberTest.java
* Update FibonacciNumberTest.java
* Update FibonacciNumberTest.java
* Update FibonacciNumber.java
* Update FibonacciNumberTest.java
* Update FibonacciNumberTest.java
* Update src/main/java/com/thealgorithms/maths/FibonacciNumber.java
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
* Update FibonacciNumber.java
* Update FibonacciNumberTest.java
* Update FibonacciNumberTest.java
* Update FibonacciNumber.java
* Update FibonacciNumberTest.java
* Update FibonacciNumberTest.java
* Delete src/main/java/com/thealgorithms/maths/FibonacciNumberTest.java
* Create FibonacciNumberTest.java
* Update FibonacciNumber.java
* Update FibonacciNumberTest.java
* Update FibonacciNumber.java
* Update FibonacciNumber.java
* Update FibonacciNumber.java
* Update FibonacciNumber.java
* Update FibonacciNumberTest.java
* Update src/test/java/com/thealgorithms/maths/FibonacciNumberTest.java
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
* Update src/main/java/com/thealgorithms/maths/FibonacciNumber.java
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
* Create FibonacciCalculator.java
* Update FibonacciNumberTest.java
* Update and rename FibonacciCalculator.java to FibCalc.java
* Update FibonacciNumberTest.java
* Update FibCalc.java
* Update FibonacciNumber.java
* Delete src/test/java/com/thealgorithms/maths/FibCalc.java
* Create FibCalc.java
* Update FibonacciNumberTest.java
* Update FibCalc.java
* Update FibonacciNumberTest.java
* Update FibonacciNumber.java
* Update FibonacciNumberTest.java
* Update FibonacciNumber.java
* Update FibonacciNumber.java
* Update FibonacciNumber.java
* Update FibonacciNumber.java
* Update FibonacciNumberTest.java
* Update FibonacciNumber.java
* fix: use proper name
* fix: use proper class name
* tests: add `returnsCorrectValues`
* Update and rename FibCalc.java to Fibonacci.java
* Update Fibonacci.java
* Update FibonacciNumber.java
* Update FibonacciNumberTest.java
* Update FibonacciNumberTest.java
* Update Fibonacci.java
* Update FibonacciNumber.java
* Update and rename FibCalcTest.java to FibonacciTest.java
* Update FibonacciNumber.java
* Update Fibonacci.java
* Update Fibonacci.java
* Update Fibonacci.java
* Update FibonacciTest.java
* Update Fibonacci.java
* Update src/main/java/com/thealgorithms/maths/Fibonacci.java
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
* Update src/main/java/com/thealgorithms/maths/FibonacciNumber.java
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
* Update src/test/java/com/thealgorithms/maths/FibonacciNumberTest.java
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
* Update src/test/java/com/thealgorithms/maths/FibonacciNumberTest.java
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
* Update FibonacciTest.java
* Update FibonacciNumberTest.java
* Update FibonacciNumberTest.java
* Update FibonacciTest.java
* Update src/main/java/com/thealgorithms/maths/Fibonacci.java
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
* Update src/main/java/com/thealgorithms/maths/FibonacciNumber.java
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
* Update src/test/java/com/thealgorithms/maths/FibonacciNumberTest.java
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
* Update src/test/java/com/thealgorithms/maths/FibonacciTest.java
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
* Update src/main/java/com/thealgorithms/maths/Fibonacci.java
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
* Update src/main/java/com/thealgorithms/maths/FibonacciNumber.java
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
* Update src/main/java/com/thealgorithms/maths/FibonacciNumber.java
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
* Update src/main/java/com/thealgorithms/maths/FibonacciNumber.java
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
* Update src/main/java/com/thealgorithms/maths/FibonacciNumber.java
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
* Update src/main/java/com/thealgorithms/maths/FibonacciNumber.java
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
* Update src/test/java/com/thealgorithms/maths/FibonacciNumberTest.java
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
* Update src/test/java/com/thealgorithms/maths/FibonacciNumberTest.java
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
* Update src/test/java/com/thealgorithms/maths/FibonacciNumberTest.java
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
* Update FibonacciNumber.java
* Update FibonacciNumber.java
* Update Fibonacci.java
* Update FibonacciNumber.java
* Update and rename FibonacciNumber.java to FibonacciNumberGoldenRation.java
* Update and rename FibonacciNumberTest.java to FibonacciNumberGoldenRationTest.java
* Update Fibonacci.java
* Update FibonacciNumberGoldenRation.java
* Update FibonacciNumberGoldenRationTest.java
* Update FibonacciTest.java
* Update Fibonacci.java
* Update FibonacciNumberGoldenRationTest.java
* Update FibonacciNumberGoldenRationTest.java
* Update FibonacciNumberGoldenRation.java
* Update FibonacciNumberGoldenRation.java
* Update FibonacciNumberGoldenRationTest.java
* Update FibonacciNumberGoldenRationTest.java
* Update src/main/java/com/thealgorithms/maths/FibonacciNumberGoldenRation.java
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
* Update and rename Fibonacci.java to FibonacciLoop.java
* Update FibonacciNumberGoldenRation.java
* Update FibonacciNumberGoldenRationTest.java
* Update and rename FibonacciTest.java to FibonacciLoopTest.java
* Update FibonacciLoop.java
* Update FibonacciLoop.java
* Update FibonacciNumberGoldenRation.java
* docs: add missing dot
---------
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
Co-authored-by: vil02 <vil02@o2.pl>
2023-10-13 21:23:30 +02:00