SlideShare a Scribd company logo
1 of 12
Sets And Disjoint Sets Union By: Ankita Goyal
Definition ,[object Object]
Operation we can perform: ,[object Object],[object Object],[object Object]
Possible representations of sets ,[object Object],1 7 8 9 5 2 10 3 4 6
Possible Representations of S1 U S2 1 7 9 8 2 5 10 7 10 2 1 5 9 8 S1 ∪ S2 S1 ∪ S2
Data representation for s1, s2 and s3 1 6 3 5 4 2 10 7 8 9 S1 S2 S3
Array representation of S1, S2 and S3 i [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] p -1 5 -1 3 -1 3 1 1 1 5
Simple algorithms for union and find ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Weighting rule for Union(i,j) ,[object Object]
Trees obtained using the weighted rule ,[object Object],[object Object],1 2 n 3 2 1 5 4 n n 3 2 1 4 n 4 3 2 1 2 n 3 1
Union algorithm with weighting rule ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Thank You

More Related Content

What's hot

Algorithm analysis
Algorithm analysisAlgorithm analysis
Algorithm analysis
sumitbardhan
 

What's hot (20)

Greedy Algorihm
Greedy AlgorihmGreedy Algorihm
Greedy Algorihm
 
Compiler design lab programs
Compiler design lab programs Compiler design lab programs
Compiler design lab programs
 
Agents in Artificial intelligence
Agents in Artificial intelligence Agents in Artificial intelligence
Agents in Artificial intelligence
 
Graph in data structure
Graph in data structureGraph in data structure
Graph in data structure
 
Unit 1 chapter 1 Design and Analysis of Algorithms
Unit 1   chapter 1 Design and Analysis of AlgorithmsUnit 1   chapter 1 Design and Analysis of Algorithms
Unit 1 chapter 1 Design and Analysis of Algorithms
 
Merge Sort
Merge SortMerge Sort
Merge Sort
 
Algorithm analysis
Algorithm analysisAlgorithm analysis
Algorithm analysis
 
Algorithms Lecture 7: Graph Algorithms
Algorithms Lecture 7: Graph AlgorithmsAlgorithms Lecture 7: Graph Algorithms
Algorithms Lecture 7: Graph Algorithms
 
Recognition-of-tokens
Recognition-of-tokensRecognition-of-tokens
Recognition-of-tokens
 
Np cooks theorem
Np cooks theoremNp cooks theorem
Np cooks theorem
 
Birch Algorithm With Solved Example
Birch Algorithm With Solved ExampleBirch Algorithm With Solved Example
Birch Algorithm With Solved Example
 
Randomized algorithms ver 1.0
Randomized algorithms ver 1.0Randomized algorithms ver 1.0
Randomized algorithms ver 1.0
 
Mathematical Analysis of Recursive Algorithm.
Mathematical Analysis of Recursive Algorithm.Mathematical Analysis of Recursive Algorithm.
Mathematical Analysis of Recursive Algorithm.
 
Graph coloring using backtracking
Graph coloring using backtrackingGraph coloring using backtracking
Graph coloring using backtracking
 
AI: Learning in AI
AI: Learning in AI AI: Learning in AI
AI: Learning in AI
 
Data Structures- Part5 recursion
Data Structures- Part5 recursionData Structures- Part5 recursion
Data Structures- Part5 recursion
 
1.10. pumping lemma for regular sets
1.10. pumping lemma for regular sets1.10. pumping lemma for regular sets
1.10. pumping lemma for regular sets
 
Church Turing Thesis
Church Turing ThesisChurch Turing Thesis
Church Turing Thesis
 
Design and analysis of algorithms
Design and analysis of algorithmsDesign and analysis of algorithms
Design and analysis of algorithms
 
And or graph
And or graphAnd or graph
And or graph
 

Viewers also liked

Set data structure
Set data structure Set data structure
Set data structure
Tech_MX
 
Advanced Algorithms #1 - Union/Find on Disjoint-set Data Structures.
Advanced Algorithms #1 - Union/Find on Disjoint-set Data Structures.Advanced Algorithms #1 - Union/Find on Disjoint-set Data Structures.
Advanced Algorithms #1 - Union/Find on Disjoint-set Data Structures.
Andrea Angella
 
Set data structure 2
Set data structure 2Set data structure 2
Set data structure 2
Tech_MX
 
Recurrence relationclass 5
Recurrence relationclass 5Recurrence relationclass 5
Recurrence relationclass 5
Kumar
 
lecture 21
lecture 21lecture 21
lecture 21
sajinsc
 

Viewers also liked (20)

Set Operations - Union Find and Bloom Filters
Set Operations - Union Find and Bloom FiltersSet Operations - Union Find and Bloom Filters
Set Operations - Union Find and Bloom Filters
 
Disjoint sets
Disjoint setsDisjoint sets
Disjoint sets
 
07. disjoint set
07. disjoint set07. disjoint set
07. disjoint set
 
Set data structure
Set data structure Set data structure
Set data structure
 
Union find
Union findUnion find
Union find
 
Advanced Algorithms #1 - Union/Find on Disjoint-set Data Structures.
Advanced Algorithms #1 - Union/Find on Disjoint-set Data Structures.Advanced Algorithms #1 - Union/Find on Disjoint-set Data Structures.
Advanced Algorithms #1 - Union/Find on Disjoint-set Data Structures.
 
Set data structure 2
Set data structure 2Set data structure 2
Set data structure 2
 
Recurrence relationclass 5
Recurrence relationclass 5Recurrence relationclass 5
Recurrence relationclass 5
 
Big o notation
Big o notationBig o notation
Big o notation
 
01. design & analysis of agorithm intro & complexity analysis
01. design & analysis of agorithm intro & complexity analysis01. design & analysis of agorithm intro & complexity analysis
01. design & analysis of agorithm intro & complexity analysis
 
17 Disjoint Set Representation
17 Disjoint Set Representation17 Disjoint Set Representation
17 Disjoint Set Representation
 
02 Notes Divide and Conquer
02 Notes Divide and Conquer02 Notes Divide and Conquer
02 Notes Divide and Conquer
 
Algorithm Introduction
Algorithm IntroductionAlgorithm Introduction
Algorithm Introduction
 
Algorithm Design and Complexity - Course 1&2
Algorithm Design and Complexity - Course 1&2Algorithm Design and Complexity - Course 1&2
Algorithm Design and Complexity - Course 1&2
 
chapter24.ppt
chapter24.pptchapter24.ppt
chapter24.ppt
 
Time complexity of union find
Time complexity of union findTime complexity of union find
Time complexity of union find
 
18 Basic Graph Algorithms
18 Basic Graph Algorithms18 Basic Graph Algorithms
18 Basic Graph Algorithms
 
lecture 21
lecture 21lecture 21
lecture 21
 
Huffman tree
Huffman tree Huffman tree
Huffman tree
 
Radix 4 FFT algorithm and it time complexity computation
Radix 4 FFT algorithm and it time complexity computationRadix 4 FFT algorithm and it time complexity computation
Radix 4 FFT algorithm and it time complexity computation
 

Similar to Sets and disjoint sets union123

computer notes - Data Structures - 29
computer notes - Data Structures - 29computer notes - Data Structures - 29
computer notes - Data Structures - 29
ecomputernotes
 
ee220s02lec10.ppt.........................
ee220s02lec10.ppt.........................ee220s02lec10.ppt.........................
ee220s02lec10.ppt.........................
AnilKumar914552
 
An Experiment to Determine and Compare Practical Efficiency of Insertion Sort...
An Experiment to Determine and Compare Practical Efficiency of Insertion Sort...An Experiment to Determine and Compare Practical Efficiency of Insertion Sort...
An Experiment to Determine and Compare Practical Efficiency of Insertion Sort...
Tosin Amuda
 
DS Complete notes for Computer science and Engineering
DS Complete notes for Computer science and EngineeringDS Complete notes for Computer science and Engineering
DS Complete notes for Computer science and Engineering
RAJASEKHARV8
 

Similar to Sets and disjoint sets union123 (20)

Disjoint sets union, find
Disjoint sets  union, findDisjoint sets  union, find
Disjoint sets union, find
 
DISJOINT SETS.pptx
DISJOINT SETS.pptxDISJOINT SETS.pptx
DISJOINT SETS.pptx
 
Mca ii dfs u-1 introduction to data structure
Mca ii dfs u-1 introduction to data structureMca ii dfs u-1 introduction to data structure
Mca ii dfs u-1 introduction to data structure
 
Bca ii dfs u-1 introduction to data structure
Bca ii dfs u-1 introduction to data structureBca ii dfs u-1 introduction to data structure
Bca ii dfs u-1 introduction to data structure
 
Path compression
Path compressionPath compression
Path compression
 
Bsc cs ii dfs u-1 introduction to data structure
Bsc cs ii dfs u-1 introduction to data structureBsc cs ii dfs u-1 introduction to data structure
Bsc cs ii dfs u-1 introduction to data structure
 
computer notes - Data Structures - 29
computer notes - Data Structures - 29computer notes - Data Structures - 29
computer notes - Data Structures - 29
 
ee220s02lec10.ppt.........................
ee220s02lec10.ppt.........................ee220s02lec10.ppt.........................
ee220s02lec10.ppt.........................
 
IRJET- A Survey on Different Searching Algorithms
IRJET- A Survey on Different Searching AlgorithmsIRJET- A Survey on Different Searching Algorithms
IRJET- A Survey on Different Searching Algorithms
 
Chapter 8 advanced sorting and hashing for print
Chapter 8 advanced sorting and hashing for printChapter 8 advanced sorting and hashing for print
Chapter 8 advanced sorting and hashing for print
 
A Real Time Application of Soft Set in Parameterization Reduction for Decisio...
A Real Time Application of Soft Set in Parameterization Reduction for Decisio...A Real Time Application of Soft Set in Parameterization Reduction for Decisio...
A Real Time Application of Soft Set in Parameterization Reduction for Decisio...
 
07+08slide.pptx
07+08slide.pptx07+08slide.pptx
07+08slide.pptx
 
An Experiment to Determine and Compare Practical Efficiency of Insertion Sort...
An Experiment to Determine and Compare Practical Efficiency of Insertion Sort...An Experiment to Determine and Compare Practical Efficiency of Insertion Sort...
An Experiment to Determine and Compare Practical Efficiency of Insertion Sort...
 
Set relationship, set operation and sigmoid
Set relationship, set operation and sigmoidSet relationship, set operation and sigmoid
Set relationship, set operation and sigmoid
 
A NEW PERSPECTIVE OF PARAMODULATION COMPLEXITY BY SOLVING 100 SLIDING BLOCK P...
A NEW PERSPECTIVE OF PARAMODULATION COMPLEXITY BY SOLVING 100 SLIDING BLOCK P...A NEW PERSPECTIVE OF PARAMODULATION COMPLEXITY BY SOLVING 100 SLIDING BLOCK P...
A NEW PERSPECTIVE OF PARAMODULATION COMPLEXITY BY SOLVING 100 SLIDING BLOCK P...
 
DATA STRUCTURE BY SIVASANKARI
DATA STRUCTURE BY SIVASANKARIDATA STRUCTURE BY SIVASANKARI
DATA STRUCTURE BY SIVASANKARI
 
DSA chapter 1
DSA chapter 1DSA chapter 1
DSA chapter 1
 
datastructure concepts ppt-190327174340.pptx
datastructure concepts ppt-190327174340.pptxdatastructure concepts ppt-190327174340.pptx
datastructure concepts ppt-190327174340.pptx
 
Discrete mathematic
Discrete mathematicDiscrete mathematic
Discrete mathematic
 
DS Complete notes for Computer science and Engineering
DS Complete notes for Computer science and EngineeringDS Complete notes for Computer science and Engineering
DS Complete notes for Computer science and Engineering
 

Recently uploaded

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Recently uploaded (20)

On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
latest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answerslatest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answers
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Basic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationBasic Intentional Injuries Health Education
Basic Intentional Injuries Health Education
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 

Sets and disjoint sets union123