Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatio Temporal Database Management International Workshop Stdbm 99 Edinburgh Scotland September 10 11 1999 Proceedings Lncs 1678

Authors: Michael H. Bohlen ,Christian S. Jensen ,Michel O. Scholl

1999th Edition

3540664017, 978-3540664017

More Books

Students also viewed these Databases questions

Question

7-2 What are the different types of networks?

Answered: 1 week ago