sparse matrix and its representations matrix is two-dimensional data object made of rows and columnstherefore having total values if most of the elements of the matrix have valuethen it is called sparse matrix why to use sparse matrix instead of simple matrix storagethere are lesser non-zero elements than zeros and thus lesser memory can be used to store only those elements computing timecomputing time can be saved by logically designing data structure traversing only non-zero elements example representing sparse matrix by array leads to wastage of lots of memory as zeroes in the matrix are of no use in most of the cases soinstead of storing zeroes with non-zero elementswe only store non-zero elements this means storing non-zero elements with triples(rowcolumnvaluesparse matrix representations can be done in many ways following are two common representations array representation linked list representation method using arrays #include int main(/assume sparse matrix int sparsematrix[ ][ { }{ }{ }{ }int size for (int ++for (int ++if (sparsematrix[ ][ ! size++int compactmatrix[ ][size]/making of new matrix