* feat: add Sieve of Eratosthenes algorithm
- Implement Sieve of Eratosthenes for finding prime numbers up to n
- Add comprehensive unit tests with edge cases
- Include JavaDoc documentation
- Time complexity: O(n log log n)
- Space complexity: O(n)
Resolves#6939
* fix: remove trailing spaces
* fix: apply clang-format
* Add Power of Four Check using bit manipulation
- Implements isPowerOfFour method using bit manipulation
- Checks if number is power of two and has bit at even position
- Includes comprehensive unit tests
- Fixes#6940
* Fix code formatting in PowerOfFourTest
* Move PowerOfFour classes to maths package
* Fix package declaration in PowerOfFourTest
* Fix code formatting in PowerOfFourTest
* Remove redundant import from PowerOfFourTest
* Remove unrelated file
- Implements conversions between Celsius, Fahrenheit, and Kelvin
- Includes all 6 conversion methods
- Adds comprehensive unit tests with edge cases
- Fixes#6936
* Add Trapping Rainwater problem implementation (Two Pointer Approach)
* Add Wikipedia reference link for Trapping Rainwater problem
* fix: format TrappingRainwater.java for CI check
* fix: add package and resolve checkstyle errors for TrappingRainwater.java
* fix: declare TrappingRainwater as final to pass Checkstyle
* Add test cases for TrappingRainwater algorithm
* Add test cases for TrappingRainwater algorithm
* Move TrappingRainwater algorithm to stacks package
* Fix: Move TrappingRainwater to stacks and normalize newline in JugglerSequence
* Fix: Normalize newline in JugglerSequence to ensure test consistency
* Fix: Normalize newline in JugglerSequence and remove return statement
* Add JaCoCo plugin for code coverage reporting
* Revert pom.xml to original version from master
* Fix: Revert the pom.xml file
---------
Co-authored-by: Deniz Altunkapan <deniz.altunkapan@outlook.com>
* add CombinationSum and test
* Format array and list literals in CombinationSumTest
* Fix sorting comparator in CombinationSumTest
* Refactor CombinationSum for better handling and clarity
Updated combinationSum method to handle null or empty candidates and improved variable naming for clarity.
* Fix sorting comparator in CombinationSumTest
* Update CombinationSumTest.java
* Fix sorting comparator for list of integers
* Fix formatting issues in CombinationSum class
* Change CombinationSum class to final
* Refactor norm method to accept Iterable instead of List
* Remove unnecessary whitespace in CombinationSumTest
* Added LU decomposition algorthm
* Added LU decomposition algorthim
* Added LU decomposition algorthim
* Added LU decomposition algorthim
* Added LU decomposition algorthim
* Added LU decomposition algorthim
* Added LU decomposition algorthim
* Added LU decomposition algorthim
* Added LU decomposition algorthim
* feat: Add BitRotate utility for circular bit rotations
* feat: Add BitRotate utility for circular bit rotations
* feat: Add BitRotate utility for circular bit rotations
* fix: Remove trailing spaces and add newline at EOF
---------
Co-authored-by: Yajunesh M R <yajunesh@Yajuneshs-MacBook-Pro.local>
* feat(geometry): add Bentley-Ottmann line segment intersection algorithm
- Implement sweep-line algorithm for finding all intersection points
- Time complexity: O((n + k) log n) where n is segments, k is intersections
- Uses event queue (PriorityQueue) and status structure (TreeSet)
- Handles vertical/horizontal segments, collinear overlaps, and touching endpoints
- Includes comprehensive Javadoc with examples and references
* test(geometry): add comprehensive tests for Bentley-Ottmann algorithm
- 19 test cases covering typical, edge, and degenerate cases
- Tests include: single/multiple intersections, parallel segments, grid patterns
- Performance test with 100 random segments
- All tests validate correctness of intersection detection
* style(geometry): fix code style
* test(geometry): Achieve 100% test coverage for BentleyOttmann
* style(geometry): fix code style again
* fix: correct import order in BentleyOttmann
* fix(geometry): Resolve SpotBugs and PMD static analysis warnings
* Reorder import statements in BentleyOttmannTest
---------
Co-authored-by: Deniz Altunkapan <deniz.altunkapan@outlook.com>
* Fix ConvexHull to return points in counter-clockwise order
- Add sortCounterClockwise method to ensure CCW ordering
- Start from bottom-most, left-most point for deterministic results
- Fix issue where unordered HashSet broke downstream algorithms
- Add comprehensive tests with CCW order verification
* test(geometry): Achieve 100% test coverage for ConvexHull
* Adding DampedOscillator code
* Adding one more test case
* Adding one more test case
* Adding one more test case
* Fixing build issues.
* Fixing build issues.
* feat(graph): add Push–Relabel max flow with tests and index
* style(checkstyle): reduce discharge parameter count via State holder
* chore(pmd): make discharge void and remove empty else; satisfy PMD
---------
Co-authored-by: a <alexanderklmn@gmail.com>
* Create TortoiseHareAlgorithm.java
Implement TortoiseHareAlgo with append, getMiddle, and toString methods
- Added generic singly linked list with inner Node class
- Implemented append() to add elements
- Implemented getMiddle() using Tortoise-Hare approach
- Added toString() for readable list representation
* Create TortoiseHareAlgoTest.java
Add JUnit tests for TortoiseHareAlgo
- Verified append() and toString() output
- Tested getMiddle() for odd, even, and empty lists
- Ensured correct behavior and null handling
* Update README.md
Add TortoiseHareAlgo to linked list documentation
- Added TortoiseHareAlgo.java to file descriptions
- Described its purpose: finding middle element using Tortoise-Hare algorithm
* Rename TortoiseHareAlgorithm.java to TortoiseHareAlgo.java
Fixed build error
* Update TortoiseHareAlgoTest.java
Fixed line formatting build error
* Update TortoiseHareAlgoTest.java
Fixed line formatting build error
* Update TortoiseHareAlgo.java
Added {} after if statement instead of directly writing statement
* Update TortoiseHareAlgo.java
Fixed line formatting build error
* Update TortoiseHareAlgo.java
Added {} after if statement instead of directly writing statement
* Update TortoiseHareAlgoTest.java
Replace .* import with specific imports
---------
Co-authored-by: Deniz Altunkapan <deniz.altunkapan@outlook.com>
* Add Yen’s K-shortest loopless paths with tests and index update
* style: fix Checkstyle in Yens algorithm and tests
* fix: resolve SpotBugs in Yens algorithm
* fix (PMD): rename short variables in the code
* (pmd): code fixes
* fix(bloomfilter): hash arrays by content to satisfy array membership tests
* style(pmd): fix EmptyControlStatement in validate() by returning early when src==dst
* style(pmd): remove unnecessary return in validate()
* 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>