Whats a more efficient way to write this function for a


Question: What's a more efficient way to write this function for a matrix? This one has to go through all the numbers, but that would take too long. r_num is row and c_num is column

int matrix::get(int x, int y)

{

element* p= r_link[x];

while (p != NULL) {

if(p->c_num == y+1)

return p->value;

p=p->r_next;

}

return 0;

}

Write this program in c language. Define each and every function in details.

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Whats a more efficient way to write this function for a
Reference No:- TGS0945067

Expected delivery within 24 Hours