* feat: add comprehensive test coverage for ProcessDetails entity class (#6588)
- Add ProcessDetailsTest.java with 20 comprehensive test methods
- Cover all constructors, getters, and setters
- Include edge cases: null values, negatives, zeros, max values
- Add real-world scheduling scenario tests
- Ensure 100% line coverage for ProcessDetails class
- Follow project checkstyle rules and conventions
Fixes#6588
* fix: resolve SpotBugs UC_USELESS_OBJECT warning in ProcessDetailsTest
- Add assertions for process1 in testMultipleProcessesIndependence method
- Verify both processes are properly tested for independence
- Ensure all created objects are meaningfully used in tests
Fixes SpotBugs warning: UC_USELESS_OBJECT at line 224
---------
Co-authored-by: Oleksandr Klymenko <alexanderklmn@gmail.com>
* Add Sum of Squares algorithm implementation
* Format code and add Wikipedia URL for Lagrange's theorem
* Fixed clang-format issues
---------
Co-authored-by: Oleksandr Klymenko <alexanderklmn@gmail.com>
* Fix MiniMaxAlgorithm setScores bug and add comprehensive tests
- Fix bug in setScores method where scores.length % 1 == 0 always returned true
- Add isPowerOfTwo helper method to properly validate array length
- Add comprehensive unit tests covering edge cases and algorithm correctness
- Tests include validation for power of 2 check, minimax logic, and error handling
Fixes issue with incorrect validation logic in MiniMaxAlgorithm.setScores()
* Fix Checkstyle violations and improve setScores validation
- Replace star imports with explicit imports in test file
- Remove trailing whitespaces from all lines
- Add proper file ending newline
- Improve setScores method to handle edge cases properly
- Use direct bit manipulation for power-of-2 check as suggested
- Ensure error message is printed and scores remain unchanged for invalid input
All Checkstyle violations resolved and tests pass successfully.
* Add missing newline at end of MiniMaxAlgorithmTest.java
- Fix Checkstyle violation: NewlineAtEndOfFile
- Ensure file ends with proper newline character
- All tests continue to pass successfully
* Fix PMD violation by utilizing isPowerOfTwo method
- Replace inline bit manipulation with isPowerOfTwo method call
- Resolves PMD UnusedPrivateMethod violation
- Maintains same validation logic and error handling
- All tests continue to pass successfully
* test: improve MiniMaxAlgorithm test coverage for CodeCov
- Add comprehensive test cases for isPowerOfTwo function edge cases
- Test setScores method with various invalid array lengths (0, 3, 5, 6, 7, 9, 10, 15)
- Add tests for large valid powers of 2 (up to 64 elements)
- Ensure complete coverage of error handling branches
- Increase test count from 14 to 19 tests
- Fix partial coverage issues identified in CodeCov report
Resolves CodeCov coverage gaps in MiniMaxAlgorithm.java
* Fix checkstyle errors
* Fix checkstyle errors
---------
Co-authored-by: ssaha <ssaha@wiley.com>
Co-authored-by: Deniz Altunkapan <93663085+DenizAltunkapan@users.noreply.github.com>
* Migrate recursive reverse string method and tests to ReverseString
- Moved recursive reverse method from ReverseStringRecursive.java to ReverseString.java
- Moved tests from ReverseStringRecursiveTest.java to ReverseStringTest.java
- Deleted old ReverseStringRecursive files
* Fix formatting for ReverseStringTest.java as per clang-format linter
* fix: revert ReverseStack deletions and ensure lint compliance
* Fix formatting for ReverseStack and test files
* Delete ReverseStackUsingRecursion and its test as requested
---------
Co-authored-by: Deniz Altunkapan <93663085+DenizAltunkapan@users.noreply.github.com>
* Add DFS with parent-completion constraint for DAG traversal
* warning in PartitionProblem.java affecting tests
* added clang-format and updated javadoc
* optimized imports and rechecked camelCase format in tests
* removed .* import and made small visual change
* replaced a inline return with correct {} block
* Removed changed in PartitionProblem.java, Renamed class name to be straightforward about the implementation.Added full names instead of shortcuts, and included record.
* updated for clang format
---------
Co-authored-by: Deniz Altunkapan <93663085+DenizAltunkapan@users.noreply.github.com>
* Remove duplicate SimpleSort (same logic as ExchangeSort)
* Removed test class for SimpleSort as it was also duplicate
---------
Co-authored-by: Lucas G <lucasgomesm1808@gmail.com>
* feat: Add 0/1 Knapsack and its tabulation implementation with their corresponding tests
* feat: Add 0/1 Knapsack and its tabulation implementation with their corresponding tests
* feat: Add 0/1 Knapsack and its tabulation implementation with their corresponding tests
* Feat:add 0/1knapsack and 0/1knapsacktabulation along with their tests
* Feat:add 0/1knapsack and 0/1knapsacktabulation along with their tests
* Feat:add 0/1knapsack and 0/1knapsacktabulation along with their tests
---------
Co-authored-by: Oleksandr Klymenko <alexanderklmn@gmail.com>
* Added Random Replacement cache
* Implement cache with LIFO replacement policy
* Ran clang-format
* Make necessary variables final, replace HashMap.newHashMap(int capacity) with new HashMap<>(int capacity)
---------
Co-authored-by: Deniz Altunkapan <93663085+DenizAltunkapan@users.noreply.github.com>
* MatrixMultiplication.java created and updated.
* Add necessary comment to MatrixMultiplication.java
* Create MatrixMultiplicationTest.java
* method for 2 by 2 matrix multiplication is created
* Use assertMatrixEquals(), otherwise there can be error due to floating point arithmetic errors
* assertMatrixEquals method created and updated
* method created for 3by2 matrix multiply with 2by1 matrix
* method created for null matrix multiplication
* method for test matrix dimension error
* method for test empty matrix input
* testMultiply3by2and2by1 test case updated
* Check for empty matrices part updated
* Updated Unit test coverage
* files updated
* clean the code
* clean the code
* Updated files with google-java-format
* Updated files
* Updated files
* Updated files
* Updated files
* Add reference links and complexities
* Add test cases for 1by1 matrix and non-rectangular matrix
* Add reference links and complexities
---------
Co-authored-by: Deniz Altunkapan <93663085+DenizAltunkapan@users.noreply.github.com>
* testing: improving DequeTest
* testing: redundant case
* testing: fix to many static imports
* testing: add more test cases
---------
Co-authored-by: Deniz Altunkapan <93663085+DenizAltunkapan@users.noreply.github.com>
* test: added Tests for Point.java
* style: fixed formatting and comments
* style: formatted with clang-format and renamed variables
* style: fixed imports to not use the '.*' form
---------
Co-authored-by: Aaron <aaron@hochschule.de>
Co-authored-by: Deniz Altunkapan <93663085+DenizAltunkapan@users.noreply.github.com>