Question
Using C++ and Linked-List Write a program that takes the user console input of a sparse matrix, check if matrix is square like 3x3, 4x4,
Using C++ and Linked-List
Write a program that takes the user console input of a sparse matrix,
check if matrix is square like 3x3, 4x4, 5x5, ...,
find the determinant recursively and print the answer
cannot use 2D array
cannot allocate zero valued entries to memory
so a linked list would only store row, column, and value of all non-zero values of the matrix
use the formula to find the determinant
for any j
Example of user entered inputs below
"input is separated by space(column) and enter key to follow the next line(row)"
Input 1:
1 2 3
4 5 6
Output 1:
Error! This is not a square matrix
Input 2:
1 0 2
-1 0 -1
0 1 0
Output 2:
The matrix determinant is: -1
numkows- det = ((-1)'+) *ali, j] * det(Minor(ali, j))) 0Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started