* Add Dinics max flow algorithm with tests and index update
* Docs: add Dinic reference link and apply clang-format
* Fix: Checkstyle violations in Dinic and tests
* style: apply clang-format to Dinic and tests
---------
Co-authored-by: a <alexanderklmn@gmail.com>
* feat: added TwoSat solutions and Tests and also updated Directory.md
* added reference urls to the article related to the 2-SAT
* Fix generic type warnings in TwoSat.java
* maven build fix: added rawtypes in SuppressWarnings
* fixed checkstyle error
* fix: Sorted import order
---------
Co-authored-by: a <alexanderklmn@gmail.com>
* feat: add Germain and Safe prime utility class with unit tests
* refactor the code
* fixed identified bugs
* fixed identified remaining bugs
---------
Co-authored-by: Deniz Altunkapan <93663085+DenizAltunkapan@users.noreply.github.com>
* feat: FloodFill Algorithm with iterative approach
- nested class Point: helper class, represents point in 2D field (x,y)
- shouldSkipPixel method: helper method to validate point
- floodFill method: iterative version of floodFill, uses Queue to add and poll Points and change it color if allowed
* feat: tests for IterativeFloodFill
-same tests as for normal floodFill and test for a big image
* docs: add link to floodFill algorithm
* codeStyle fix
* tests: add tests for edge cases
* codeStyle fix
* codeStyle fix
* codeStyle fix
* refactor: reorganize structure and add JavaDoc
- Move private methods after public methods for better readability
- Add class-level JavaDoc documentation with algorithm description and links to references
* feat: add sieve of atkin algorithm
* fix: add full test coverage
* refactor: if condition braces
---------
Co-authored-by: a <alexanderklmn@gmail.com>
* Add Sum of Squares algorithm implementation
* Format code and add Wikipedia URL for Lagrange's theorem
* Fixed clang-format issues
* Added Mo's Algorithm and DiceThrower recursive algorithms
- Mo's Algorithm: Square root decomposition for offline range queries(Imp in CP)
- DiceThrower: Recursive backtracking for dice combinations(very imp)
- Both algorithms include comprehensive test suites
- Formatted with clang-format and i follow contribution guidelines
* Fixed checkstyle violation
* Fixed SpotBugs issue
* Added in PMD exclusions
* Improved test coverage for better Codecov scores.
* Fixed clang-format issues in test files
* Add Mo's Algorithm and DiceThrower algorithms with comprehensive tests
* Fixed PartitionProblem.java documentation comment placement
* feat(ciphers): Add PermutationCipher implementation with comprehensive tests
- Implement PermutationCipher class for transposition encryption/decryption
- Add encrypt() and decrypt() methods with permutation key support
- Include robust key validation (1-based positions, no duplicates)
- Implement automatic padding for incomplete blocks using 'X' character
- Add comprehensive error handling with descriptive exceptions
- Create 20+ JUnit test cases covering encryption, decryption, edge cases
- Support various key sizes and text processing (spaces removal, case handling)
- Include detailed JavaDoc documentation with algorithm explanation
Algorithm Details:
- Divides plaintext into blocks based on key length
- Rearranges characters within each block according to permutation positions
- Supports round-trip encryption/decryption with inverse permutation
- Handles edge cases: empty strings, single character keys, padding
Tests include: basic functionality, different key sizes, error validation,
real-world examples, and edge case handling.
* Run PermutationCipherTest using Maven
* refactor(PermutationCipher): clean up code by removing unnecessary whitespace and comments
* fix(tests): remove unnecessary whitespace in test assertion for encryption
* fix(tests): correct indentation in assertion for encryption verification
---------
Co-authored-by: a <alexanderklmn@gmail.com>
* 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>