Daniel Sánchez Núñez d382e656f2 Adding method to check wether a matrix is stochastic (#7184)
* Add StochasticMatrix utility class

This class provides methods to check if a matrix is row-stochastic or column-stochastic, ensuring all elements are non-negative and the sums of rows or columns equal 1.

* Change package from maths to matrix

Updated package declaration for StochasticMatrix class.

* Change package declaration in StochasticMatrixTest

* Delete src/test/java/com/thealgorithms/StochasticMatrixTest.java

* Refactor matrix initialization for test cases

* Fix formatting of matrix initialization in tests

* Remove unnecessary newline in StochasticMatrix

* Add import statement for JUnit in StochasticMatrixTest

* Add additional assertions to StochasticMatrixTest

* Clean up import statements in StochasticMatrixTest

Removed unused import statements for cleaner code.

* Reorder import statements in StochasticMatrixTest

* Remove unused import assertThrows from StochasticMatrixTest

Removed unused import for assertThrows.
2025-12-28 10:53:12 +01:00
2024-09-22 01:54:47 +05:30
2024-01-08 23:48:11 +02:00
2021-02-25 16:15:52 -06:00
2023-06-14 15:37:14 +03:00
2024-04-08 18:08:35 +00:00

The Algorithms - Java

Build codecov Discord chat Gitpod ready-to-code

You can run and edit the algorithms, or contribute to them using Gitpod.io (a free online development environment) with a single click.

Open in Gitpod

All algorithms are implemented in Java (for educational purposes)

These implementations are intended for learning purposes. As such, they may be less efficient than the Java standard library.

Contribution Guidelines

Please read our Contribution Guidelines before you contribute to this project.

Algorithms

Our directory has the full list of applications.

Languages
Java 100%