c program for sparse matrix using array
02:44/*Represent sparse matrix using array and perform matrix addition,simple
transpose and fast transpose */
output :>
1)Read the First Sparse Matrix
2)Read the second sparse matrix
3)Display the first matrix
4)Display the second matrix
5)Addition of two matrices
6)Simple transpose of the first matrix
7)Fast transpose of the first matrix
8)Quit
Enter your choice : 1
Enter the size of matrix (rows,columns):2 2
Enter no. of non-zero elements:3
Enter the next triple(row,column,value):2 3 5
Enter the next triple(row,column,value):0 2 1
Enter the next triple(row,column,value):2 5 8
1)Read the First Sparse Matrix
2)Read the second sparse matrix
3)Display the first matrix
4)Display the second matrix
5)Addition of two matrices
6)Simple transpose of the first matrix
7)Fast transpose of the first matrix
8)Quit
Enter your choice : 3
rows = 2 columns = 2
2 3 5
0 2 1
2 5 8
Enter your choice : 2
Enter the size of matrix (rows,columns):2 2
Enter no. of non-zero elements:3
Enter the next triple(row,column,value):4 5 7
Enter the next triple(row,column,value):3 5 9
Enter the next triple(row,column,value):3 0 3
1)Read the First Sparse Matrix
2)Read the second sparse matrix
3)Display the first matrix
4)Display the second matrix
5)Addition of two matrices
6)Simple transpose of the first matrix
7)Fast transpose of the first matrix
8)Quit
Enter your choice : 5
rows = 2 columns = 2
2 3 5
0 2 1
2 5 8
4 3 5
3 2 1
3 5 8
1)Read the First Sparse Matrix
2)Read the second sparse matrix
3)Display the first matrix
4)Display the second matrix
5)Addition of two matrices
6)Simple transpose of the first matrix
7)Fast transpose of the first matrix
8)Quit
Enter your choice : 8
0 comments: