Add a method to the CRS class called getElement that takes a row index i and a column index j and returns the element in the sparse matrix that is in row i and column j. The first line of this method would be
float getElement(int i, int j)
Hint: You should start by examining the row_ptr array to find where the ith row starts and where it ends in the array val. Then search the appropriate portion of the col_idx array to find an element with column index j.