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.