1. Member
Join Date
Jul 2011
Posts
18
Rep Power
0

## Determinant of matrix

The determinant of a matrix can be cal- culated by taking performing the following for every entry in the 0th row of a matrix.

(a) If the matrix has only 1 row and 1 column, then the determinant is just whatever that 1 entry is.

(b) Otherwise, for a number in the ith column (starting from zero) and 0th row, cross off (temporarily) the entire ith column and 0th row.

(c) The resulting matrix has 1 fewer row and 1 fewer column after crossing them off. Take the determinant of this matrix and multiply the result by the value in the ith column and 0th row.

(d) If i is odd, multiply the result by negative 1. (e) Sum up all such results.

USING RECURSION write a method to calculate the determinant of a matrix.

The header should look something like this:
public static int calculateDeterminant(int[][] m)

2. Moderator
Join Date
Feb 2009
Location
New Zealand
Posts
4,712
Rep Power
15
Hi osenna, welcome to the forum.

I'm sure you don't expect anyone here to do your homework for you! (for this or the other 3 posts) But to get started and provide some help we need to know what the problem is: not the assignment you were given, but the problem you have doing that assignment.

Do you understand the assignment? If not, what questions do you have about it?

Have you written code to attempt to do what the assignment asks? If you have and there are compiler messages that you can't understand, post the code and the entire compiler message(s).

Does your program compile sucessfully but do something weird at runtime? (throw an exception, or give a result that you know is incorrect). If so, post the code and say what the actual behaviour at runtime is, and what you were expecting to happen.

-----

I guess this observation and these questions apply to your other posts, although I haven't read them in any detail.

3. Let's close all of the homework dump threads and start over. Osenna, I invite you to repost any questions that you have, but please show your work and ask a specific question. Repeatedly posting homework or interview dumps can result in your being banned.
Last edited by Fubarable; 07-03-2011 at 05:00 AM.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•