A matrix containing a large number of zero values are compared to the non-zero values is called a sparse matrix. It can be represented using array or linked list.
In linked list representation, there exists a node consisting of four fields: row, col, num and first. The reo and col …