Question: I create a C++ program using the following template: template vector find_row_maxima_itr(const matrix & m) { // Your code here } The program is supposed
I create a C++ program using the following template:
template
vector
// Your code here
}
The program is supposed to search for the maxima row by row. On each row, it linearly scans each element to find the maximum and pushes it to the back of a vector. The runtime is apparently O(mn). The code is as follows:

But I'm getting the following error:

I know it's putting the values inside the vector because it's printing it. However, it's saying that the pointer isn't being allocated? Can you help me figure out why I'm getting this error?
template
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
