1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
#include <iostream>
#include <ctime>
#include "OrderedLL.h"
//Function Prototypes
void Copy(int Set[], OrderedLL<int> &set, int counter);
using namespace std;
int main()
{
time_t r;
time(&r);
cout << "Today is " << ctime(&r) << endl;
int a[5] = {7, 5, 9, 2, 8};
int a_count = 5;
int b[4] = {2, 5, 11, 4};
int b_count = 4;
OrderedLL<int> setA, setB, set_union;
Copy(a, setA, a_count);
Copy(b, setB, b_count);
DisplaySet(setA);
DisplaySet(setB);
Union(setA, setB, set_union);
DisplaySet(set_union);
return 0;
}
void Copy(int Set[], OrderedLL<int> &set, int counter)
{
for(int i = 0; i < counter; i++)
{
set.Insert(Set[i]);
}
}
|