***********************************************************************
CS201 Lab 8, Winter 08
Vectors and Functions
***********************************************************************
1. Implement the merge() function with the following prototype:
vector merge(vector a, vector b);
The function expects a and b to be already sorted and it returns
a new vector which is the sorted combination of a and b.
USE THE ALGORITHM GIVEN IN CLASS.
You must supply your own main() function that inputs two sequences
of numbers into two different vectors, calls a sort() function for
each vector, and then prints out the resulting merged vector.
Hand in a printout of the program and a sample typescript of a run.
2. Implement the equal() function with the following prototype:
bool equal(vector a, vector b);
This function returns true if every element in a exists in b and
every element in b exists in a (a is a subset of b and b is a subset
of a). The function returns false otherwise.
For example, if a contained
8 2 4 1 2 16 4 1 2 4
and b contained
2 16 8 1 4 8 2
then the function would return true.
Again, you must design your own test main() function to input the
values of both vectors, call equal(), and print the result.
Hint: use a helper function exist() with the following prototype:
bool exist(int x, vector y);
which returns true if x is in vector y, and false otherwise.
Hand in a printout of the program and a sample typescript of a run.