Challenge

Project 1 - Creation of user defined data type to implement the user interfaces for working with ‘Set’ (Mathematical Set theory) using Linked List

Overview of the Project:

  • The Given two Linked List, create union and intersection lists that contain union and intersection of the

elements present in the given lists.

  • And hear the main objective of the project is to do the mathematical set operation.
  • Here we are creating a structure it structure it has a collecion different data.
  • IN the process to first creare two lists using the reference address.
  • The main concept of linkedlist is self referential structure.

Goals:

  • First we have to create a utility function to insert a node at the beginning of a linked list.
  • In that, we are creating two datatypes 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 wha are mentioned in the main program.

Key Highlights of the Project:

  • First, we are getting the size of the list, using the for loop we are inserting the for loop, we use the insert node function.
  • In these functions, we are using arguments are 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.

Deliverables of this project:

  • Function to get union of two linked lists head1 and head2.
  • Function to get intersection of two linked lists head1 and head2.
  • Traverse list and search each element of it in list2. If the element is present in list 2, then insert the element to result
  • A utility function to insert a node at the beginning of a linked list.
  • A untility function that returns true if data is present in linked list else return false

Expected outcomes:

  • It is used to display the data of the different lists by using different arguments passing to the display function.
  • So, creating the temaparary list with the head is null. And print data and use the next address stored in the pointer variable pointer variable pointing to the structure.
  • if head next has it recognize it has last node.

Program:

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.