Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
4 views
10 pages
FDS7
fds 7
Uploaded by
Pragati Shirole
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF, TXT or read online on Scribd
Download
Save
Save FDS7 For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
4 views
10 pages
FDS7
fds 7
Uploaded by
Pragati Shirole
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF, TXT or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save FDS7 For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save FDS7 For Later
You are on page 1
/ 10
Search
Fullscreen
#include<iostream>
using namespace std;
struct SLLNode* createSLL(int cnt, struct SLLNode *head);
void displaySLL(struct SLLNode *head);
void A_U_B();
void A_int_B();
void A_Min_B();
void B_Min_A();
void U_Min_A_U_B();
struct SLLNode
{
char data;
struct SLLNode *next;
}*headU, *headA, *headB;
int main()
{
int i,no;
cout<<"\n\n\t How many Linked Lists: ";
cin>>no;
headU = headA = headB = NULL;
for(i=1; i<=no; i++)
{
if(i == 1)
{
cout<<"\n\n\t Enter 10 Students of SE Comp : ";
headU = createSLL(10, headU);
cout<<"\n";
displaySLL(headU);
}
if(i == 2)
{
cout<<"\n\n\t Enter 5 Students who like Vanilla Icecreme: ";
headA = createSLL(5, headA);
cout<<"\n";
displaySLL(headA);
}
if(i == 3)
{
cout<<"\n\n\t Enter 5 Students who like Butterscotch Icecreme: ";
headB = createSLL(5, headB);
cout<<"\n";
displaySLL(headB);
}
}
cout<<"\n\n Input Sets:------------------------";
cout<<"\n\n Set 'U': ";
displaySLL(headU);
cout<<"\n\n Set 'A': ";
displaySLL(headA);
cout<<"\n\n Set 'B': ";
displaySLL(headB);
cout<<"\n\n Output Sets:------------------------";
A_U_B();
A_int_B();
A_Min_B();
B_Min_A();
U_Min_A_U_B();
cout<<"\n\n";
return 0;
}
//.........................................................Function to create Linked List as Sets.
struct SLLNode* createSLL(int cnt, struct SLLNode *head)
{
int i;
struct SLLNode *p, *newNode;
for(i=0; i<cnt; i++)
{
newNode = new(struct SLLNode); // 1. DMA
cout<<"\n\t Enter Student Initial: "; // 2. Data & Address Assignment
cin>>newNode->data;
newNode->next = NULL;
if(head == NULL) // 3. Add node in the list
{
head = newNode;
p = head;
}
else
{
p->next = newNode;
p = p->next;
}
}
return head;
}
//...............................................Function to display Linked Lists as Sets.
void displaySLL(struct SLLNode *head)
{
struct SLLNode *p;
p = head;
while(p != NULL)
{
cout<<" "<<p->data;
p = p->next;
}
}
//................................................Function for Set A U B .
void A_U_B()
{
int i,j;
char a[10];
struct SLLNode *p, *q;
i = 0; //Index of Resultant Array
p = headA; //pointer to Set 'A'
q = headB; //pointer to Set 'B'
while(p != NULL && q != NULL)
{
if(p->data == q->data)
{
a[i] = p->data;
i++;
p = p->next;
q = q->next;
}
else
{
a[i] = p->data;
i++;
p = p->next;
}
}
if(p == NULL) //Set 'A' copied completely
{
while(q != NULL) //Copy remaining elements of Set 'B'
{
a[i] = q->data;
i++;
q = q->next;
}
}
if(q == NULL) //Set 'B' copied completely
{
while(p != NULL) //Copy remaining elements of Set 'A'
{
a[i] = p->data;
i++;
p = p->next;
}
}
cout<<"\n\n\t Set A U B: ";
for(j=0; j < i; j++)
cout<<" "<<a[j];
}
//................................................Function for Set A ^ B .
void A_int_B()
{
int i,j;
char a[10];
struct SLLNode *p, *q;
i = 0; //Index of Resultant Array
p = headA; //pointer to Set 'A'
while(p != NULL)
{
q = headB; //pointer to Set 'B'
while(q != NULL)
{
if(p->data == q->data)
{
a[i] = p->data;
i++;
}
q = q->next;
}
p = p->next;
}
cout<<"\n\n\t Set A ^ B: ";
for(j=0; j < i; j++)
cout<<" "<<a[j];
}
//................................................Function for Set A - B .
void A_Min_B()
{
int i,j,flag;
char a[10];
struct SLLNode *p, *q;
i = 0; //Index of Resultant Array
p = headA; //pointer to Set 'A'
while(p != NULL)
{
flag = 0;
q = headB; //pointer to Set 'B'
while(q != NULL)
{
if(p->data == q->data)
{
flag = 1;
}
q = q->next;
}
if(flag == 0)
{
a[i] = p->data;
i++;
}
p = p->next;
}
cout<<"\n\n\t Set A - B: ";
for(j=0; j < i; j++)
cout<<" "<<a[j];
}
//................................................Function for Set B - A.
void B_Min_A()
{
int i,j,flag;
char a[10];
struct SLLNode *p, *q;
i = 0; //Index of Resultant Array
q = headB; //pointer to Set 'B'
while(q != NULL)
{
flag = 0;
p = headA; //pointer to Set 'A'
while(p != NULL)
{
if(q->data == p->data)
{
flag = 1;
}
p = p->next;
}
if(flag == 0)
{
a[i] = q->data;
i++;
}
q = q->next;
}
cout<<"\n\n\t Set B - A: ";
for(j=0; j < i; j++)
cout<<" "<<a[j];
}
//................................................Function for Set U - (A U B).
void U_Min_A_U_B()
{
int i,j,flag;
char a[10];
struct SLLNode *p, *q, *r;
i = 0; //Index of Resultant Array
p = headU; //pointer to Set 'U'
while(p != NULL)
{
flag = 0;
q = headA; //pointer to Set 'A'
r = headB; //pointer to Set 'B'
while(q != NULL)
{
if(p->data == q->data)
{
flag = 1;
}
q = q->next;
}
while(r != NULL)
{
if(p->data == r->data)
{
flag = 1;
}
r = r->next;
}
if(flag == 0)
{
a[i] = p->data;
i++;
}
p = p->next;
}
cout<<"\n\n\t Set U - (A U B): ";
for(j=0; j < i; j++)
cout<<" "<<a[j];
}
You might also like
Motorola Mt2000 RSS Manual
PDF
100% (1)
Motorola Mt2000 RSS Manual
304 pages
Answer Scheme Quiz CSC126 - March2021
PDF
No ratings yet
Answer Scheme Quiz CSC126 - March2021
4 pages
DSA All Programs
PDF
No ratings yet
DSA All Programs
65 pages
Aaaa 1111
PDF
No ratings yet
Aaaa 1111
6 pages
DS Practical File
PDF
No ratings yet
DS Practical File
73 pages
Discrete Math Practical
PDF
No ratings yet
Discrete Math Practical
96 pages
Samarth College of Engineering & Management, Belhe: Food Rescue
PDF
No ratings yet
Samarth College of Engineering & Management, Belhe: Food Rescue
19 pages
DSA Assignment 1 w1
PDF
No ratings yet
DSA Assignment 1 w1
23 pages
Hpc301 User Manual
PDF
No ratings yet
Hpc301 User Manual
25 pages
1.write A C++ Program To Reverse A Given Positive Integer Number and Display The Result
PDF
No ratings yet
1.write A C++ Program To Reverse A Given Positive Integer Number and Display The Result
10 pages
DSAL11 Word
PDF
No ratings yet
DSAL11 Word
8 pages
Ke Unit 4 Notes
PDF
No ratings yet
Ke Unit 4 Notes
22 pages
Dsa Lab 10,11,12,13
PDF
No ratings yet
Dsa Lab 10,11,12,13
20 pages
Mil PPT 2
PDF
No ratings yet
Mil PPT 2
21 pages
DS PRACTICAL FILE Adaya
PDF
No ratings yet
DS PRACTICAL FILE Adaya
50 pages
Long Program
PDF
No ratings yet
Long Program
14 pages
03 134241 017 132709114925 24032025 082035pm
PDF
No ratings yet
03 134241 017 132709114925 24032025 082035pm
18 pages
DSAL3 Word
PDF
No ratings yet
DSAL3 Word
5 pages
FDS12
PDF
No ratings yet
FDS12
12 pages
Vaish p2
PDF
No ratings yet
Vaish p2
6 pages
List CSE111
PDF
No ratings yet
List CSE111
11 pages
DSAL8 Word
PDF
No ratings yet
DSAL8 Word
5 pages
MP Pragati
PDF
No ratings yet
MP Pragati
40 pages
MP & MC End Sem Quetion Bank
PDF
No ratings yet
MP & MC End Sem Quetion Bank
2 pages
DSAL10 Word
PDF
No ratings yet
DSAL10 Word
3 pages
Karan Mamania Resume
PDF
No ratings yet
Karan Mamania Resume
1 page
Dsa Codes 1to 8
PDF
No ratings yet
Dsa Codes 1to 8
44 pages
SET A - Coding Questions - DIFFICULT - VVCE
PDF
No ratings yet
SET A - Coding Questions - DIFFICULT - VVCE
11 pages
BM Assignment
PDF
No ratings yet
BM Assignment
7 pages
FDS2
PDF
No ratings yet
FDS2
6 pages
1 PBL
PDF
No ratings yet
1 PBL
3 pages
Include
PDF
No ratings yet
Include
6 pages
Q 4
PDF
No ratings yet
Q 4
14 pages
Lab Assessment-2: Jayendra Jamadar
PDF
No ratings yet
Lab Assessment-2: Jayendra Jamadar
14 pages
Portfolio Synopsis
PDF
No ratings yet
Portfolio Synopsis
4 pages
Problem Statement
PDF
No ratings yet
Problem Statement
1 page
Unit 2 Mam Notes
PDF
No ratings yet
Unit 2 Mam Notes
10 pages
1 Title and Certificate Capstone Project Ayush
PDF
No ratings yet
1 Title and Certificate Capstone Project Ayush
3 pages
5 Chapter 3
PDF
No ratings yet
5 Chapter 3
2 pages
Advanced Data Structures Lab Updated
PDF
No ratings yet
Advanced Data Structures Lab Updated
14 pages
DISCRETESTRUCTURE LABPROGRAM2022.docx 20240806 072843 0000
PDF
No ratings yet
DISCRETESTRUCTURE LABPROGRAM2022.docx 20240806 072843 0000
9 pages
SAIF DSA Lab Experiment
PDF
No ratings yet
SAIF DSA Lab Experiment
73 pages
22HCS4114
PDF
No ratings yet
22HCS4114
70 pages
Lab 311
PDF
No ratings yet
Lab 311
17 pages
Data Structures Lab ALL EXPERIMENTS FILE
PDF
No ratings yet
Data Structures Lab ALL EXPERIMENTS FILE
84 pages
Gaurav Kumar Dsa File
PDF
No ratings yet
Gaurav Kumar Dsa File
15 pages
Audit Course Report Format
PDF
No ratings yet
Audit Course Report Format
15 pages
Ap Merged
PDF
No ratings yet
Ap Merged
20 pages
Linked List Lab Report
PDF
No ratings yet
Linked List Lab Report
7 pages
All Dsa Program
PDF
No ratings yet
All Dsa Program
35 pages
Sample File
PDF
No ratings yet
Sample File
14 pages
Set
PDF
No ratings yet
Set
2 pages
DSL Lab KCS353
PDF
No ratings yet
DSL Lab KCS353
22 pages
Bsee21036 Assignment 03
PDF
No ratings yet
Bsee21036 Assignment 03
6 pages
Dsa Practical Questions
PDF
No ratings yet
Dsa Practical Questions
40 pages
23-NTU-CS-1170 (Lab 3)
PDF
No ratings yet
23-NTU-CS-1170 (Lab 3)
33 pages
#Include #Include #Include Using Namespace Class Public Int Void
PDF
No ratings yet
#Include #Include #Include Using Namespace Class Public Int Void
6 pages
#Include #Include #Include Using Namespace Class Public Int Void
PDF
No ratings yet
#Include #Include #Include Using Namespace Class Public Int Void
6 pages
DSTL Practical Files
PDF
No ratings yet
DSTL Practical Files
14 pages
Adaspam
PDF
No ratings yet
Adaspam
15 pages
Roll No 150252 Lab-2: Exercise 1
PDF
No ratings yet
Roll No 150252 Lab-2: Exercise 1
7 pages
Final THKTLT
PDF
No ratings yet
Final THKTLT
2 pages
Arduino + Raspberry Pi + Sending Data To The Web
PDF
100% (1)
Arduino + Raspberry Pi + Sending Data To The Web
4 pages
US5784124
PDF
No ratings yet
US5784124
13 pages
BMI Autopsy: 1 1 3 1 1 1 1 2 1 3 1 1 1 2 2 1 2 3 3 2 4 1 2 1 1 2 1 2 1 1 1 Total Result 23 27 50
PDF
No ratings yet
BMI Autopsy: 1 1 3 1 1 1 1 2 1 3 1 1 1 2 2 1 2 3 3 2 4 1 2 1 1 2 1 2 1 1 1 Total Result 23 27 50
4 pages
Discrete Structures and Logic Lab by Vishal Kushwaha
PDF
No ratings yet
Discrete Structures and Logic Lab by Vishal Kushwaha
32 pages
AVLTrees
PDF
No ratings yet
AVLTrees
2 pages
Process Transformations Distribution Networks Responsibility Assignments Timing Cycles Inventory Sets Motivation Intentions
PDF
No ratings yet
Process Transformations Distribution Networks Responsibility Assignments Timing Cycles Inventory Sets Motivation Intentions
3 pages
Part B - Solutions
PDF
No ratings yet
Part B - Solutions
3 pages
Final THKTLT
PDF
No ratings yet
Final THKTLT
2 pages
Lab File
PDF
No ratings yet
Lab File
96 pages
Assignment - 1
PDF
No ratings yet
Assignment - 1
35 pages
Audit Courseeeeeee
PDF
No ratings yet
Audit Courseeeeeee
13 pages
Rman
PDF
No ratings yet
Rman
3 pages
QUESTION #1 Solution
PDF
No ratings yet
QUESTION #1 Solution
2 pages
3 Chapter 1
PDF
No ratings yet
3 Chapter 1
4 pages
1
PDF
No ratings yet
1
21 pages
Activity 1.2.5 Mechanical System Efficiency - VEX
PDF
No ratings yet
Activity 1.2.5 Mechanical System Efficiency - VEX
10 pages
Index: S.No Date Experiments NO Signature Object Oriented Programming
PDF
No ratings yet
Index: S.No Date Experiments NO Signature Object Oriented Programming
56 pages
C++ Practical File
PDF
No ratings yet
C++ Practical File
51 pages
C Revision
PDF
No ratings yet
C Revision
36 pages
Prog
PDF
No ratings yet
Prog
10 pages
DS Practical File by Simran
PDF
No ratings yet
DS Practical File by Simran
65 pages
Zip Grade 50 Questionv 2
PDF
No ratings yet
Zip Grade 50 Questionv 2
1 page
Submitted To: Ma'am Aiemen Akif Sumitted By: Ameer Hamza Muhammad Muneeb Malik Muhammad Shoaib Class: B.E.T.E-51 Section: "C"
PDF
No ratings yet
Submitted To: Ma'am Aiemen Akif Sumitted By: Ameer Hamza Muhammad Muneeb Malik Muhammad Shoaib Class: B.E.T.E-51 Section: "C"
12 pages
Transcript 4
PDF
No ratings yet
Transcript 4
1 page
Robot Vision 15678
PDF
No ratings yet
Robot Vision 15678
139 pages
Banking & Finance Banking: Central Bank of India Case Study
PDF
No ratings yet
Banking & Finance Banking: Central Bank of India Case Study
1 page
"Stdafx.h" "Cmath" "Iostream": Node Node Newdata Newdata
PDF
No ratings yet
"Stdafx.h" "Cmath" "Iostream": Node Node Newdata Newdata
4 pages
20 Things in Life You Realize Only When It's Too Late
PDF
No ratings yet
20 Things in Life You Realize Only When It's Too Late
9 pages
Workshop 4
PDF
100% (1)
Workshop 4
3 pages
Audit Course Report
PDF
No ratings yet
Audit Course Report
13 pages
#Include #Include"set.h": "Please Input " "Elements Now /N"
PDF
No ratings yet
#Include #Include"set.h": "Please Input " "Elements Now /N"
5 pages
LAB1
PDF
No ratings yet
LAB1
12 pages
GW-7228 J1939/Modbus RTU Slave Gateway: User's Manual
PDF
No ratings yet
GW-7228 J1939/Modbus RTU Slave Gateway: User's Manual
48 pages
Trucos de Diseño Gráfico para No Diseñadores
PDF
No ratings yet
Trucos de Diseño Gráfico para No Diseñadores
30 pages
Multiprocessor System Architecture
PDF
No ratings yet
Multiprocessor System Architecture
11 pages
A Quick Start Guide On Lua For C C Programme
PDF
No ratings yet
A Quick Start Guide On Lua For C C Programme
37 pages
Data Structure and Algorithm Lab Programs
PDF
No ratings yet
Data Structure and Algorithm Lab Programs
51 pages
Javascript Programming Bootcamp
PDF
No ratings yet
Javascript Programming Bootcamp
11 pages
Hidden Patterns, Unknown Correlations, Market Trends, Customer Preferences and Other Useful Information That Can Help Organizations Make More-Informed Business Decisions
PDF
No ratings yet
Hidden Patterns, Unknown Correlations, Market Trends, Customer Preferences and Other Useful Information That Can Help Organizations Make More-Informed Business Decisions
4 pages
Programming SQL Server 2012: Prelude
PDF
No ratings yet
Programming SQL Server 2012: Prelude
8 pages
SAP MM Module Resume With 3 Years Experience
PDF
0% (1)
SAP MM Module Resume With 3 Years Experience
5 pages
(PDF) Fundamentals of Data Structure in C
PDF
No ratings yet
(PDF) Fundamentals of Data Structure in C
202 pages
VPN Questionnaire
PDF
No ratings yet
VPN Questionnaire
2 pages
Coverity Meeting DO 178B Requirements
PDF
No ratings yet
Coverity Meeting DO 178B Requirements
14 pages
Cam Desenhos
PDF
No ratings yet
Cam Desenhos
46 pages
150+ C Pattern Programs
From Everand
150+ C Pattern Programs
Hernando Abella
No ratings yet