Question: struct Element { int value; int row; int column; struct Element *rowElement; struct Element *columnElement; }; struct Header { int index; struct Header *header; struct

struct Element {

int value;

int row;

int column;

struct Element *rowElement;

struct Element *columnElement;

};

struct Header {

int index;

struct Header *header;

struct Element *element;

};

struct Matrix {

struct Header *headRowHeader;

struct Header *headColumnHeader;

int rows;

int columns;

int fillValue;

};

struct Matrix MTRX_alloc(char *filename, int fillValue); //need help solving this

void MTRX_free(struct Matrix* m); //need help solving this

int MTRX_getElement(struct Matrix *m, int row, int column); //need help solving this

void MTRX_write(struct Matrix *m, char *filename); //need help solving this

struct Matrix MTRX_add(struct Matrix *a, struct Matrix *b, int fillValue); //need help solving this

struct Matrix MTRX_multiply(struct Matrix *a, struct Matrix *b, int fillValue); //need help solving this

struct Matrix MTRX_transpose(struct Matrix *m); //need help solving this

int main() {

struct Matrix a, t;

a = MTRX_alloc("matrixA.txt", 0);

t = MTRX_transpose(&a);

MTRX_write(&t, "matrixT.txt");

MTRX_free(&t);

MTRX_free(&a);

return 0;

}

###########

matrixT.txt:

0 0 4 0 0 0 0 0 0 0 0 2 0 0 8 0 9 0 0 4 0 0 0 0

#########

matrixA.txt:

0 0 0 0 9 0 0 0 0 0 0 0 4 0 0 8 0 0 0 0 2 0 4 0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!