Commit Graph

983 Commits

Author SHA1 Message Date
Priyanshu Kumar Singh
e21aee814c [FEAT] Add Newton's Law of Gravitation algorithm (#6855)
Co-authored-by: Priyanshu1303d <priyanshu130d@gmail.com>
2025-10-25 17:18:15 +02:00
Indolyn Yi
ab65ac6485 feat(compression): Add Burrows-Wheeler Transform (BWT) and Move-to-Front (MTF) (#6926)
* feat(compression): Add Burrows-Wheeler Transform (BWT) and Move-to-Front (MTF)

* Resolve SpotBugs

* fix code style
2025-10-25 11:29:45 +02:00
Indole Yi
48ba1ae466 feat(compression): Add LZ77 and LZ78 algorithms (#6910)
* feat(compression): Add LZ77 and LZ78 algorithms

* Resolve Spotbugs warning in LZ78 by using Trie structure

* fix code style
2025-10-23 18:16:46 +02:00
Hardik Pawar
f66da5e5ee refactor: Enhance docs, add tests in PrintMatrixInSpiralOrder (#6636)
* refactor: Enhance docs, add tests in `PrintMatrixInSpiralOrder`

* Fix error in BloomFilter

* Fix

* Fix

* Fix
2025-10-22 19:42:11 +00:00
Yash Rajput
89303690f2 Added SimplePendulumRK4 (#6800)
* Added SimplePendulumRK4

* Fixed build issue.

* Fixed build issue.

* Fixed build issue.
2025-10-21 20:18:32 +00:00
Indole Yi
d5289b92da Fix ConvexHull to return points in counter-clockwise order (#6810)
* 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
2025-10-19 18:17:19 +00:00
Indole Yi
4a97258189 feat(compression): Add LZW and Arithmetic Coding algorithms (#6799)
* feat(compression): Add LZW and Arithmetic Coding algorithms

* test(compression): Improve test coverage for LZW and ArithmeticCoding

* style(compression): fix code style
2025-10-19 18:11:22 +00:00
Yash Rajput
a7f0bab021 Adding ElasticCollision2D (#6802)
* Adding ElasticCollision2D

* Fixing build issues.
2025-10-19 17:00:32 +00:00
Saahil Mahato
b312567dc3 feat: add DDA line drawing algorithm (#6616)
* feat: add DDA line drawing algorithm

* refactor: clang formatting

---------

Co-authored-by: Deniz Altunkapan <deniz.altunkapan@outlook.com>
2025-10-18 11:41:01 +00:00
Harshendu Swarnakar
6b7d201657 Hierholzer path algorithm (#6822)
* Added HierholzerEulerianPath algorithm

* Added Hierholzer Algorith to find Eulerian Path

* Added Hierholzer Algorith to find Eulerian Path

* Added Hierholzer Algorith to find Eulerian Path

* Added Hierholzer Algorith to find Eulerian Path

* Added Hierholzer Algorith to find Eulerian Path

* Added Hierholzer Algorith to find Eulerian Path

* Added Hierholzer Algorith to find Eulerian Path

---------

Co-authored-by: crashmovies <swarnakarharshendu420@gmail.com>
2025-10-17 23:53:26 +02:00
Hardik Pawar
4858ec9af0 refactor: Enhance docs, code, add tests in `MaximumSumOfDistinctSubar… (#6649)
* refactor: Enhance docs, code, add tests in `MaximumSumOfDistinctSubarraysWithLengthK`

* Fix

* Fix spotbug

* Fix

* Fix

* Fix

* Fix
2025-10-17 07:53:39 +00:00
Yash Rajput
e1773e9165 Adding DampedOscillator code (#6801)
* Adding DampedOscillator code

* Adding one more test case

* Adding one more test case

* Adding one more test case

* Fixing build issues.

* Fixing build issues.
2025-10-16 23:19:09 +02:00
Sameer Prajapati
fb5a7653c1 feat: Add Hungarian Algorithm (Assignment Problem) with tests and reference [GRAPHS] (#6808)
* feat(graph): add Hungarian Algorithm (assignment) with tests; update directory

* style(graph): split multiple variable declarations to satisfy Checkstyle
2025-10-16 23:05:48 +02:00
Sameer Prajapati
1437036b19 feat(graph): add Push–Relabel max flow with tests and index (#6793)
* 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>
2025-10-15 22:51:14 +02:00
Hardik Pawar
f8688ba38d refactor: Enhance docs, code, add tests in Means (#6750) 2025-10-15 09:14:00 +00:00
Hardik Pawar
c6497a23ec refactor: Enhance docs, code, add tests in LucasSeries (#6749) 2025-10-15 09:07:49 +00:00
Hardik Pawar
f460c601d3 refactor: Enhance docs, code, add tests in HeronsFormula (#6746)
* refactor: Enhance docs, code, add tests in `HeronsFormula`

* Fix lint
2025-10-15 08:56:57 +00:00
Hardik Pawar
d62b438fcd refactor: Enhance docs, code, add tests in HarshadNumber (#6745) 2025-10-15 08:46:17 +00:00
Hardik Pawar
219cc33588 refactor: Enhance docs, code, add tests in `LinearDiophantineEquation… (#6744)
refactor: Enhance docs, code, add tests in `LinearDiophantineEquationsSolver`
2025-10-15 08:42:16 +00:00
Microindole
ce6f7311f7 feat: Add RLE and Shannon-Fano compression algorithms (#6779)
* feat: Add RLE and Shannon-Fano compression algorithms

* Fix: Resolve CI failures for compression algorithms

* chore: trigger CI rebuild
2025-10-14 17:29:03 +00:00
Shivam Singh
b50d1d017b Added Sentinel Linear Search . (#6671)
* Added Sentinel Linear Search .

* Fixed linter error

* Fixed linter errors

* Fixed linter errors in test fike

* Fixed linter errors in test file

* Fixed linter errors
2025-10-14 17:22:15 +00:00
Priyanshu Kumar Singh
b316dcf1c6 [FEAT] Implement Flattening MultiLevel LinkedList (#6670)
[FEAT] Implement Flattening Multilevel LinkedList

Co-authored-by: Priyanshu1303d <priyanshu130d@gmail.com>
2025-10-14 08:56:21 +00:00
TejasSingh022
a9357102b3 Add TortoiseHareAlgo implementation with append, toString, and getMiddle methods (#6722)
* 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>
2025-10-14 08:53:02 +00:00
Sameer Prajapati
8726d401b7 Add Yen’s K-shortest loopless paths with tests [GRAPHS] (#6773)
* 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()
2025-10-13 20:22:55 +02:00
Microindole
8b8434cb51 feat(graph): Add Edmonds's algorithm for minimum spanning arborescence (#6771)
* feat(graph): Add Edmonds's algorithm for minimum spanning arborescence

* test: Add test cases to achieve 100% coverage
2025-10-13 15:47:50 +03:00
Hardik Pawar
f30d10117d refactor: Enhance docs, code, add tests in LeonardoNumber (#6743) 2025-10-13 07:42:10 +00:00
Sameer Prajapati
883a050162 Added Dinic’s Max Flow algorithm with tests [Graphs] (#6762)
* 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>
2025-10-12 23:45:46 +02:00
Hardik Pawar
387ecef310 refactor: Enhance docs, code, add tests in KeithNumber (#6748)
* refactor: Enhance docs, code, add tests in `KeithNumber`

* Fix

---------

Co-authored-by: a <alexanderklmn@gmail.com>
2025-10-12 23:37:24 +02:00
Hardik Pawar
297634d05f refactor: Enhance docs, code, add tests in KaprekarNumbers (#6747)
Co-authored-by: a <alexanderklmn@gmail.com>
2025-10-12 23:13:14 +02:00
Hardik Pawar
ff9fd2e2e4 refactor: Enhance docs, code, add tests in Median (#6751)
Co-authored-by: a <alexanderklmn@gmail.com>
2025-10-12 22:51:54 +02:00
Shoyeb Ansari
bc7b656092 feat: added TwoSat solutions with Tests, also updated Directory.md (#6756)
* 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>
2025-10-12 22:46:12 +02:00
Hardik Pawar
74ddea6747 refactor: Enhance docs, code, add tests in KrishnaMurthyNumber (#6742)
* refactor: Enhance docs, code, add tests in `KrishnaMurthyNumber`

* Lint
2025-10-12 20:04:32 +00:00
Priyanshu Kumar Singh
9a907c8843 [FEAT] Implement Dials Algorithm (Graph) (#6679)
[FEAT] Implement Dials Algorithm(Graph)

Co-authored-by: Priyanshu1303d <priyanshu130d@gmail.com>
2025-10-12 21:25:21 +02:00
Hardik Pawar
14a23b709a refactor: Enhance docs, code, add tests in LowestBasePalindrome (#6648) 2025-10-12 11:05:30 +02:00
Hardik Pawar
c0ca70498b refactor: Enhance docs, code, add tests in PageRank (#6642) 2025-10-12 06:13:58 +00:00
Hardik Pawar
7fb4c8d60f refactor: Enhance docs, code, add tests in MinimaxAlgorithm (#6641)
* refactor: Enhance docs, code, add tests in `MinimaxAlgorithm`

* Fix

* Fix

* refactor: Enhance docs, code, add tests in `HappyNumbersSeq`

* Revert "refactor: Enhance docs, code, add tests in `HappyNumbersSeq`"

This reverts commit 9e8afb4f2c.
2025-10-12 06:07:17 +00:00
Hardik Pawar
b5246c3d86 refactor: Enhance docs, code, add tests in Huffman (#6646)
* refactor: Enhance docs, code, add tests in `Huffman`

* Fix lint

* Fix lint
2025-10-12 05:50:58 +00:00
Hardik Pawar
2a004a0141 refactor: Enhance docs, code, add tests in InsertDeleteInArray (#6647) 2025-10-12 05:37:53 +00:00
Hardik Pawar
f0fb971f35 refactor: Enhance docs, add tests in PerlinNoise (#6635)
* refactor: Enhance docs, add tests in `PerlinNoise`

* Fix lint

* Fix lint

---------

Co-authored-by: Deniz Altunkapan <deniz.altunkapan@outlook.com>
2025-10-11 13:15:18 +00:00
Banula Kumarage
61fbb1855c Dev: Add Zeller's Congruence utility class to calculate the day of the week (#6614)
* Add Zeller's Congruence utility class and unit tests

* fixed identified bugs

* fixed pmd failure
2025-10-09 20:36:20 +02:00
Ruturaj Jadhav
3c071c4e08 Added HappyNumber algorithm in maths section (#6571)
* Added HappyNumber algorithm in maths section

* Fix Checkstyle: remove trailing spaces in HappyNumber

* Fix formatting: remove trailing spaces and apply clang-format

* Update HappyNumberTest.java

* Removed old HappyNumbersSeq.java as replaced by new HappyNumber.java
2025-10-09 17:31:56 +00:00
Banula Kumarage
e788111420 Dev: Added Germain and Safe prime utility class (#6611)
* 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>
2025-10-09 17:28:06 +00:00
CrodiYa
16557a9b81 Feature iterative flood fill (#6584)
* 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
2025-10-09 17:20:19 +00:00
Yash Rajput
b1aa896e17 Added GroundToGroundProjectileMotion (#6714)
* Added GroundToGroundProjectileMotion

* Fix checkstyle issues.

* Fix checkstyle issues.
2025-10-09 10:23:58 +03:00
Sachin Pangal
e22ce0005e feat-Add MaximumProductSubarray (#6711)
* feat-Add MaximumProductSubarray

* feat-changes

* fix: correct MaximumProductSubarray compilation errors

* fix-lints

* fix: apply clang-format to MaximumProductSubarrayTest.java

* fix: prevent integer overflow in MaximumProductSubarray using long type
2025-10-09 10:12:51 +03:00
Saahil Mahato
4fe37c3a10 feat: add needleman–wunsch sequence alignment algorithm (#6707)
Co-authored-by: a <alexanderklmn@gmail.com>
2025-10-08 20:27:30 +02:00
Saahil Mahato
061463a4df feat: add sieve of atkin algorithm (#6709)
* feat: add sieve of atkin algorithm

* fix: add full test coverage

* refactor: if condition braces

---------

Co-authored-by: a <alexanderklmn@gmail.com>
2025-10-08 20:18:17 +02:00
Saahil Mahato
f9edb70cd7 feat: add smith-waterman sequence alignment algorithm (#6708)
Co-authored-by: a <alexanderklmn@gmail.com>
2025-10-08 20:05:49 +02:00
Saahil Mahato
50b1bcdc67 feat: add damerau-levenshtein distance algorithm (#6706)
* feat: add damerau-levenshtein distance algorithm

* refactor: remove useless parentheses

* refactor: add class link to test
2025-10-08 18:09:18 +02:00
Yash Rajput
b031a0bbba Adding PiApproximation algo (#6602)
* Adding PiApproximation algo

* Added clang formatting

* Added private method

* checkstyle fix

* checkstyle fix

---------

Co-authored-by: Deniz Altunkapan <93663085+DenizAltunkapan@users.noreply.github.com>
2025-10-08 12:16:14 +00:00