-
Notifications
You must be signed in to change notification settings - Fork 4
/
mset.c
42 lines (42 loc) · 887 Bytes
/
mset.c
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 <stdio.h>
#include <stdlib.h>
#include "set.h"
Set S1,S2,S3;
infotype input;
int main()
{
CreateEmptySet(&S1);
CreateEmptySet(&S2);
CreateEmptySet(&S3);
TulisSet(S1);
printf("\n");
TulisSet(S2);
printf("\n");
InsertSet(&S1,5);
InsertSet(&S1,6);
InsertSet(&S1,7);
InsertSet(&S1,8);
InsertSet(&S1,9);
InsertSet(&S2,1);
InsertSet(&S2,5);
InsertSet(&S2,6);
InsertSet(&S2,3);
InsertSet(&S2,10);
TulisSet(S1);
printf("\n");
TulisSet(S2);
printf("\n");
UnionSet(S1,S2,&S3);
TulisSet(S3);
printf("\n");
CreateEmptySet(&S3);
IntersectionSet(S1,S2,&S3);
TulisSet(S3);
printf("\n");
SetDifference(S1,S2,&S3);
TulisSet(S3);
printf("\n");
printf("Elemen terkecil Set S1 : %d\n",SetMin(S1));
printf("Elemen terbesar Set S2 : %d\n",SetMax(S2));
return 0;
}