The main method in C which calls all the above functions is: #include int main(){ int s1[100], s2[100], n, m, result[200]; scanf("%d",&n); scanf("%d",&m); initialize(); //initializes the set s1 initialise(); //initializes the set s2 display(Set s1); //displays the elements of set s1 display(Set s2); //displays the elements of set s2 addNode(Set s1, int n); // add element n into the set s1 contains(Set s1, int m); // search for element m in the set s1 getUnion(Set result, Set s1, Set S2); intersection(Set result, Set s1, Set s2); difference(Set result, Set s1, Set s2); symmetric difference(Set result, Set s1, Set s2); subset(Set s1, Set s2); disjoint(Set s1, Set s2); equal(Set s1, Set S2); return 0; } Note: Please fix some of the functions cause it causes run time error, I have already used up 2 follow up questions on this, Please Send an image of a sample run and output of this code please, and find out why it wont run and modify some of the codes so that it will run.
The main method in C which calls all the above functions is:
#include<stdio.h>
int main(){
int s1[100], s2[100], n, m, result[200];
scanf("%d",&n);
scanf("%d",&m);
initialize(); //initializes the set s1
initialise(); //initializes the set s2
display(Set s1); //displays the elements of set s1
display(Set s2); //displays the elements of set s2
addNode(Set s1, int n); // add element n into the set s1
contains(Set s1, int m); // search for element m in the set s1
getUnion(Set result, Set s1, Set S2);
intersection(Set result, Set s1, Set s2);
difference(Set result, Set s1, Set s2);
symmetric difference(Set result, Set s1, Set s2);
subset(Set s1, Set s2);
disjoint(Set s1, Set s2);
equal(Set s1, Set S2);
return 0;
}
Note:
Please fix some of the functions cause it causes run time error, I have already used up 2 follow up questions on this, Please Send an image of a sample run and output of this code please, and find out why it wont run and modify some of the codes so that it will run.
Step by step
Solved in 3 steps with 2 images