Well i have an assignment for class and im having a little trouble understanding how to code this. I have 2 vectors (A & B), the goal is to 1) merge the vectors into a separate vector in the pattern of a[1], b[1], a[2], b[2], etc including duplicates if they were to occur. 2) Take those same vectors ( A & B) and merge and sort them in numerical order( lowest to biggest) then in the main function take the results and display them. Can someone set me off with some code to help me through this. Please and thank you.
#include <iostream>
#include <vector>
usingnamespace std;
int vector<int> append(vector<int> a, vector<int> b)
{
int n = a.size();
int m = b.size();
vector<int> c(n + m);
int i;
for (i = 0; i < n; i++)
c[i] = a[i];
for (i = 0; i < m; i++)
c[n + i] = b[i];
return c;
}
int vector<int> merge(vector<int> a, vector<int> b)
{
while (counter < a.size && b.size)
}
int vector<int> merge_sorted(vector<int> a, vector<int> b)
{
}
int main()
{
int input;
cout<< "Input numbers for vector A. Terminate with -1"while (cin >> input)
a.push_back(input)
count<< "Input numbers for vector B. Terminate with -1"while (cin >> input);
b.push_back(input);
cout<< "Vector A is" << << "\n";
cout<< "vector B is" << << "\n";
}