* Add additional edge cases to GCD unit tests
* Rename GCD test methods and add descriptive names
* Fix formatting in GCD tests
---------
Co-authored-by: Deniz Altunkapan <deniz.altunkapan@outlook.com>
* [FEAT] Add Thin Lens formula for ray optics
* [CI] Re-run clang-format checks
* [CI] Re-run checks after rebase
* [STYLE] Apply clang-format to ThinLensTest
---------
Co-authored-by: Koushik Sai <nyamathabadkoushik@gmail.com>
* Add unit tests for graph algorithms (BFS, DFS, Dijkstra, Bellman-Ford) #7133
- Created BellmanFordTest.java with 10 test methods covering various graph scenarios
- Created ConnectedComponentTest.java with 15 test methods for DFS-based component counting
- Enhanced MatrixGraphsTest.java with additional BFS/DFS test cases
- Enhanced DijkstraAlgorithmTest.java with comprehensive shortest path tests
Fixes#7133
* fix: format files using clang
* fix: removing my changes on pull_request_template
---------
Co-authored-by: prashantdubeypng <vinoddubey6059@gmail.com>
* Add Snell's Law implementation for refraction angle
* Add tests for Snell's Law calculations
* Update documentation with reference link to Snell's Law
Added a reference link to Snell's Law in the documentation.
* Prevent instantiation of SnellLaw class
Make SnellLaw class non-instantiable by adding a private constructor.
* Rename SnellsLawTest to SnellLawTest
* Refactor SnellLawTest for clarity and accuracy
* Rename SnellsLaw.java to SnellLaw.java
* Refactor SnellLawTest with additional assertions
* Refactor SnellLaw class constructor and error handling
Refactor SnellLaw constructor and error message formatting.
* Fix missing newline at end of SnellLawTest.java
Ensure that the SnellLawTest class has a newline at the end of the file.
* Simplify assertions in SnellLawTest
* Simplify exception throwing for total internal reflection
* Add Gomory–Hu Tree (all-pairs min-cuts via n1 max-flows)
* Stabilize Monte Carlo integration with antithetic variates to reduce variance
* Fix Checkstyle in GomoryHuTreeTest: remove inner assignments, add braces, split declarations
* SpotBugs: use RandomGenerator interface in test helper
---------
Co-authored-by: Deniz Altunkapan <deniz.altunkapan@outlook.com>
Fixed incorrect @return description in perimeterIrregularPolygon method javadoc. Changed "trapezoid" to "irregular polygon" to accurately reflect what the method calculates.
* feat: Add Centroid Decomposition for trees (#7054)
- Implement CentroidDecomposition with O(N log N) construction
- Add CentroidTree class with parent tracking and query methods
- Include buildFromEdges helper for easy tree construction
- Add comprehensive test suite with 20+ test cases
- Cover edge cases, validation, and various tree structures
Closes#7054
* feat: Add Centroid Decomposition for trees (#7054)
- Implement CentroidDecomposition with O(N log N) construction
- Add CentroidTree class with parent tracking and query methods
- Include buildFromEdges helper for easy tree construction
- Add comprehensive test suite with 20+ test cases
- Cover edge cases, validation, and various tree structures
Closes#7054
* fix: Remove trailing whitespace from CentroidDecompositionTest
* fix: Remove trailing whitespace and add newlines at end of files
* fix: Format code to comply with clang-format and checkstyle requirements
* style: Fix lambda formatting in test assertions
- Change single-line lambdas to multi-line format
- Align with repository code style guidelines
* style: Apply clang-format to match repository style guide
- Format code according to .clang-format configuration
- Use single-line lambdas as allowed by AllowShortLambdasOnASingleLine: All
- Apply 4-space indentation
- Ensure proper line endings
* feat: add Sudoku Solver using Backtracking (issue #6929)
* refactor: remove old Sudoku class from puzzlesandgames package
* Remove old Sudoku implementation and its test class
* 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>