Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
5493aa5
Add Sum of Squares algorithm implementation
BEASTSHRIRAM Oct 2, 2025
3e9f039
Format code and add Wikipedia URL for Lagrange's theorem
BEASTSHRIRAM Oct 2, 2025
e71008f
Fixed clang-format issues
BEASTSHRIRAM Oct 2, 2025
db58f80
Added Mo's Algorithm and DiceThrower recursive algorithms
BEASTSHRIRAM Oct 2, 2025
235e87a
Merge branch 'master' into added-mos-algorithm-dice-thrower
BEASTSHRIRAM Oct 2, 2025
4c421fa
Fixed checkstyle violation
BEASTSHRIRAM Oct 2, 2025
587bd7e
Merge branch 'added-mos-algorithm-dice-thrower' of https://github.com…
BEASTSHRIRAM Oct 2, 2025
857b074
Fixed SpotBugs issue
BEASTSHRIRAM Oct 2, 2025
f8f16e7
Added in PMD exclusions
BEASTSHRIRAM Oct 2, 2025
5ba8a8d
Merge branch 'master' into added-mos-algorithm-dice-thrower
BEASTSHRIRAM Oct 3, 2025
a3cf21b
Merge branch 'master' into added-mos-algorithm-dice-thrower
BEASTSHRIRAM Oct 4, 2025
fc65769
Merge branch 'master' into added-mos-algorithm-dice-thrower
BEASTSHRIRAM Oct 4, 2025
68775a1
Improved test coverage for better Codecov scores.
BEASTSHRIRAM Oct 5, 2025
04e711a
Merge branch 'added-mos-algorithm-dice-thrower' of https://github.com…
BEASTSHRIRAM Oct 5, 2025
df609d6
Fixed clang-format issues in test files
BEASTSHRIRAM Oct 5, 2025
c7a0406
Add Mo's Algorithm and DiceThrower algorithms with comprehensive tests
BEASTSHRIRAM Oct 5, 2025
b13cd3a
Merge branch 'master' into added-mos-algorithm-dice-thrower
BEASTSHRIRAM Oct 6, 2025
d9ad6a6
Merge branch 'master' into added-mos-algorithm-dice-thrower
DenizAltunkapan Oct 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed clang-format issues in test files
  • Loading branch information
BEASTSHRIRAM committed Oct 5, 2025
commit df609d636fdcd8bb6a36ce78c1cb69b2def5397a
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ void testMainMethod() {

try {
// Test main method
MosAlgorithm.main(new String[]{});
MosAlgorithm.main(new String[] {});
String output = outputStream.toString();

// Verify expected output contains demonstration
assertTrue(output.contains("Range Sum Queries Results:"));
assertTrue(output.contains("Range Frequency Queries Results:"));
Expand Down
14 changes: 7 additions & 7 deletions src/test/java/com/thealgorithms/recursion/DiceThrowerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,13 @@ void testPrintDiceCombinations() {
// Test printing combinations for target 3
DiceThrower.printDiceCombinations(3);
String output = outputStream.toString();

// Verify all expected combinations are printed
assertTrue(output.contains("111"));
assertTrue(output.contains("12"));
assertTrue(output.contains("21"));
assertTrue(output.contains("3"));

// Count number of lines (combinations)
String[] lines = output.trim().split("\n");
assertEquals(4, lines.length);
Expand All @@ -164,7 +164,7 @@ void testPrintDiceCombinationsZero() {
try {
DiceThrower.printDiceCombinations(0);
String output = outputStream.toString();

// Should print empty string (one line)
assertEquals("", output.trim());
} finally {
Expand All @@ -181,9 +181,9 @@ void testMainMethod() {

try {
// Test main method
DiceThrower.main(new String[]{});
DiceThrower.main(new String[] {});
String output = outputStream.toString();

// Verify expected output contains header and combinations
assertTrue(output.contains("All dice combinations that sum to 4:"));
assertTrue(output.contains("Total combinations: 8"));
Expand All @@ -199,7 +199,7 @@ void testMainMethod() {
void testEdgeCaseTargetFive() {
List<String> result = DiceThrower.getDiceCombinations(5);
assertEquals(16, result.size());

// Test specific combinations exist
assertTrue(result.contains("11111"));
assertTrue(result.contains("1112"));
Expand All @@ -213,7 +213,7 @@ void testEdgeCaseTargetFive() {
void testTargetGreaterThanSix() {
List<String> result = DiceThrower.getDiceCombinations(8);
assertTrue(result.size() > 0);

// Verify some expected combinations
assertTrue(result.contains("62"));
assertTrue(result.contains("53"));
Expand Down
Loading