Question: #include #include #include #include #define N 1 0 #define M 1 0 using namespace std; / / Function to create a sorted matrix. / /

#include
#include
#include
#include
#define N 10
#define M 10
using namespace std;
// Function to create a sorted matrix.
// You don't need to modify or understand this (just don't waste time)
std::vector vector > createSortedMatrix()
{
std::vector vector > matrix(N);
std::vector row(M);
int i,j,n;
srand(time(NULL));
for (i=0;i > m)
{
for (int i=0;i (write your answer HERE!)
*/
bool searchNum(vector vector > m, int e)
{
//*********
// Write your solution here for Question 1.
//*********
}
// You don't need to change the main function.
int main()
{
std::vector vector > matrix(N);
int e;
matrix = createSortedMatrix();
printSortedMatrix(matrix);
std::cout "Element to search for : ";
std:cin >> e;
bool result = searchNum(matrix,e);
if (result)
cout e " is found in the matrix!";
else
cout e " is NOT found";
return 0;
}
 #include #include #include #include #define N 10 #define M 10 using

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!