Assume the array of pointers on the left and up are represented as left and up arrays;so,left1 is left array of first matrix;so,up1 is up array of first matrix;so,left2 is left array of second matrix;so,up2 is left array of second matrix;so,let matrix obtained after multiplication be ans;given sizes of both arrays as n;so,to obtain the ans[i][j],we need to multiply ith row of first matrix and jth column of second matrix;so,get pointer to first element of ith row through left1[i].Let this be node r.and pointer to first element of jth coulmn from up2[j].Let this be node c.So,now to multiply these two we need to add products only if x of 1st array node and y of 2nd array node are equal.if move the r node to next element and vice versa.Below is the c++ code for the idea.To run this code you have to first construct the sparse matrices using the struct node.