Skip to content

Conversation

@Rony-2004
Copy link

@Rony-2004 Rony-2004 commented Oct 26, 2025

This PR adds an algorithm to compute the determinant of a square matrix in Java. It supports matrices of any size using recursion and includes proper error handling for non-square matrices.

The class is final to prevent inheritance.

Includes a private constructor to prevent instantiation.

All if statements use braces {} as required by Checkstyle.

Whitespace, formatting, and naming conventions follow repository guidelines.

Test Cases:

1x1 matrix

2x2 matrix

3x3 matrix

Singular matrix (determinant = 0)

Non-square matrix (throws IllegalArgumentException)

References:

Determinant - Wikipedia

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant