Project 1 - Creation of user defined data type to implement the user interfaces for working with ‘Set’ (Mathematical Set theory) using Linked List
live batch (PREETI MAM)
Overview of the Project:
Here the main objective of the project is to do the mathematical set operation. The set operation has many operations here they are told to do the union and
intersection of the list created as a linked list. so here we are creating a structure it has a collection of different data.
Here is the process to first create two lists using the reference address. The main concept of LinkedList is self-referential structure.
Implementation of interface for mathematical Set Theory using C programming.
First, we are creating the structure as a typedef model to rename the user-defined name.
In that, we are creating two data types int for storing the integer value, and the pointer variable is used it storing the address of the same structure itself.
And after we are creating the main function we get the values of list 1 and list 2 using the for loop and using the many function call in that.
And then we are creating the different functions which are mentioned in the main program.
Creating two lists of data using the linked list method.
First, we are getting the size of the list. Using the for loop we are inserting the data. Inside the for loop, we use the insert node function.
In these functions, we are using arguments or head address and value from the user.
Inside the inserted node, we are creating the size of the list using the malloc function.
Entering the data in the data area, And storing the address of the head to the next pointer and we are storing the new node address in the head for the next update.
Likewise, we are creating the two lists.
Getting Union of two lists.
Here we get a function call of getting union with the argument of head1 and head2
In the union function, we are using the head unit as a list by inserting the value of the first list in the union and
jumping to the next area by addressing stores in the next.
Insert node function as same as the function which is used for the creation of the linked list.
Using another while loop we are getting the second list.
Using the compare function using not we are getting only the value that is not placed in the list one and inserted in the union in the list.
Getting Intersection of two lists.
In the the intersection, we are easy to get an intersection because just we compare to list and return the value which is placed in both lists commonly.
Using the If command for comparing the data of lists 1 and 2.
if the condition is true it passes the next step which has an intersection list and using the insert function we are inserting the data into that list.
