Question: //main.cpp #include #include #include using namespace std; vector zigZag(vector v1, vector v2){ //write your code here return result; } int main(){ vector v1, v2; v1

 //main.cpp #include #include #include using namespace std; vector zigZag(vector v1, vector

//main.cpp

#include

#include

#include

using namespace std;

vector zigZag(vector v1, vector v2){

//write your code here

return result;

}

int main(){

vector v1, v2;

v1 = {50,40,20,30,10};

v2 = {1,2,3,4,5};

vectoranswer = zigZag(v1,v2);

cout

for (int i =0; i

cout

}

return 0;

}

The Problem Task: you need to merge two vectors using two priprity queues to form a zig-zag vector. The zigzag vector should have the sorted vectors interspersed with each other. Example output: vec1 50,30, 20,40, 10 vec2 8,6,7,9,5 result 150,9, 40,8, 30,7, 20,6, 10,5 Compile and Test A complete Makefile and a main. cpp file containing one simple test has been provided for you. To compile and run, run: make ./main

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!