I need build function that creates a structure for sparse empty matrix (that in entirety nils ) and returns pointer to the created structure
I need to use the functions malloc in order to create a new member from type Cell, and the address that received to return, after zeroed the member in order that will adapt to the head of the structure (line of nil, column of nil, and nullification pointersof to the right and down )
how to write this algorithm , somebody help!
Code:#include <stdlib.h> #include <stdio.h> typedef int Elem; typedef struct cell Cell; typedef Cell * Matrix; struct cell { int row; int col; Cell * right; Cell * down; Elem value; };Code:newSparseMatrix () { .... }