Question
I just need to change the two arrays into two vectors in this function. I need help, I don't know the right syntax. // C++
I just need to change the two arrays into two vectors in this function. I need help, I don't know the right syntax.
// C++ Code to find Smallest Difference between two Arrays #include
// function to calculate Small result between two arrays int findSmallestDifference(int arr1[], int arr2[], int m, int n) { // Sort both arrays using sort function sort(arr1, arr1+m); sort(arr2, arr2+n);
int a = 0, b = 0;
// Initialize result as max value int result = INT_MAX;
// Searching Both Arrays upto sizeof of the Arrays while (a // Move Smaller Value if (arr1[a] < arr2[b]) a++; else b++; } return result; // return final smallest result }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started