SlideShare a Scribd company logo
1 of 1
Download to read offline
A sequence is an abstract data type in which elements appear in order. The elements may appear
multiple times but in order.
A bag is also an abstract data type but the elements are not in order. Elements can be added to
bag but they cannot be removed from the bag. Thus deletion or removal of elements is an
additional operation required by a sequence.
Sequence can have following operations
add(), remove(item), isEmpty()
And Bag can have add(), isEmpty() only
Solution
A sequence is an abstract data type in which elements appear in order. The elements may appear
multiple times but in order.
A bag is also an abstract data type but the elements are not in order. Elements can be added to
bag but they cannot be removed from the bag. Thus deletion or removal of elements is an
additional operation required by a sequence.
Sequence can have following operations
add(), remove(item), isEmpty()
And Bag can have add(), isEmpty() only

More Related Content

More from APMRETAIL

The start of the European Colonization is typically dated to 1492, a.pdf
The start of the European Colonization is typically dated to 1492, a.pdfThe start of the European Colonization is typically dated to 1492, a.pdf
The start of the European Colonization is typically dated to 1492, a.pdf
APMRETAIL
 
Sewage before being disposed of either in river stream or on land, h.pdf
Sewage before being disposed of either in river stream or on land, h.pdfSewage before being disposed of either in river stream or on land, h.pdf
Sewage before being disposed of either in river stream or on land, h.pdf
APMRETAIL
 
Relational database was proposed by Edgar Codd (of IBM Research) aro.pdf
Relational database was proposed by Edgar Codd (of IBM Research) aro.pdfRelational database was proposed by Edgar Codd (of IBM Research) aro.pdf
Relational database was proposed by Edgar Codd (of IBM Research) aro.pdf
APMRETAIL
 
I hereby explain the SDU (service data unit )and PDU ( protocol data.pdf
I hereby explain the SDU (service data unit )and PDU ( protocol data.pdfI hereby explain the SDU (service data unit )and PDU ( protocol data.pdf
I hereby explain the SDU (service data unit )and PDU ( protocol data.pdf
APMRETAIL
 
Hi Please find my code####### RainFall.java ###################.pdf
Hi Please find my code####### RainFall.java ###################.pdfHi Please find my code####### RainFall.java ###################.pdf
Hi Please find my code####### RainFall.java ###################.pdf
APMRETAIL
 
Beacuse ...deinococcus - thermus is a phylum of bacteria that are .pdf
Beacuse ...deinococcus - thermus is a phylum of bacteria that are .pdfBeacuse ...deinococcus - thermus is a phylum of bacteria that are .pdf
Beacuse ...deinococcus - thermus is a phylum of bacteria that are .pdf
APMRETAIL
 

More from APMRETAIL (20)

O=C=O .pdf
                     O=C=O                                      .pdf                     O=C=O                                      .pdf
O=C=O .pdf
 
The start of the European Colonization is typically dated to 1492, a.pdf
The start of the European Colonization is typically dated to 1492, a.pdfThe start of the European Colonization is typically dated to 1492, a.pdf
The start of the European Colonization is typically dated to 1492, a.pdf
 
The institutions which act as mediator between savers and boorrowers.pdf
The institutions which act as mediator between savers and boorrowers.pdfThe institutions which act as mediator between savers and boorrowers.pdf
The institutions which act as mediator between savers and boorrowers.pdf
 
Solution Mitochondria is known as power house of the cell.It prod.pdf
Solution Mitochondria is known as power house of the cell.It prod.pdfSolution Mitochondria is known as power house of the cell.It prod.pdf
Solution Mitochondria is known as power house of the cell.It prod.pdf
 
Sewage before being disposed of either in river stream or on land, h.pdf
Sewage before being disposed of either in river stream or on land, h.pdfSewage before being disposed of either in river stream or on land, h.pdf
Sewage before being disposed of either in river stream or on land, h.pdf
 
Relational database was proposed by Edgar Codd (of IBM Research) aro.pdf
Relational database was proposed by Edgar Codd (of IBM Research) aro.pdfRelational database was proposed by Edgar Codd (of IBM Research) aro.pdf
Relational database was proposed by Edgar Codd (of IBM Research) aro.pdf
 
Option “D” is not true about the net neutrality.Favouring of net n.pdf
Option “D” is not true about the net neutrality.Favouring of net n.pdfOption “D” is not true about the net neutrality.Favouring of net n.pdf
Option “D” is not true about the net neutrality.Favouring of net n.pdf
 
NaF will dissociate 100, and therefore the F- will have extra 0.25 .pdf
NaF will dissociate 100, and therefore the F- will have extra 0.25 .pdfNaF will dissociate 100, and therefore the F- will have extra 0.25 .pdf
NaF will dissociate 100, and therefore the F- will have extra 0.25 .pdf
 
CO2 because the heaviest would have the most attr.pdf
                     CO2 because the heaviest would have the most attr.pdf                     CO2 because the heaviest would have the most attr.pdf
CO2 because the heaviest would have the most attr.pdf
 
Intensity of light source Io = 1000 countsIntensity after absorpti.pdf
Intensity of light source Io = 1000 countsIntensity after absorpti.pdfIntensity of light source Io = 1000 countsIntensity after absorpti.pdf
Intensity of light source Io = 1000 countsIntensity after absorpti.pdf
 
I hereby explain the SDU (service data unit )and PDU ( protocol data.pdf
I hereby explain the SDU (service data unit )and PDU ( protocol data.pdfI hereby explain the SDU (service data unit )and PDU ( protocol data.pdf
I hereby explain the SDU (service data unit )and PDU ( protocol data.pdf
 
Hop1 = 13, p2 = 13, and p3 = 13Ha at least one p is not equal.pdf
Hop1 = 13, p2 = 13, and p3 = 13Ha at least one p is not equal.pdfHop1 = 13, p2 = 13, and p3 = 13Ha at least one p is not equal.pdf
Hop1 = 13, p2 = 13, and p3 = 13Ha at least one p is not equal.pdf
 
Hi Please find my code####### RainFall.java ###################.pdf
Hi Please find my code####### RainFall.java ###################.pdfHi Please find my code####### RainFall.java ###################.pdf
Hi Please find my code####### RainFall.java ###################.pdf
 
Because an acidic environment encourages the bree.pdf
                     Because an acidic environment encourages the bree.pdf                     Because an acidic environment encourages the bree.pdf
Because an acidic environment encourages the bree.pdf
 
first order linear ordinary difernetial equation...SO I.F.=e^-.pdf
first order linear ordinary difernetial equation...SO I.F.=e^-.pdffirst order linear ordinary difernetial equation...SO I.F.=e^-.pdf
first order linear ordinary difernetial equation...SO I.F.=e^-.pdf
 
D . Found both in whales and sharks.There two kinds of animals nee.pdf
D . Found both in whales and sharks.There two kinds of animals nee.pdfD . Found both in whales and sharks.There two kinds of animals nee.pdf
D . Found both in whales and sharks.There two kinds of animals nee.pdf
 
C is correct. The interface fastEthernet 00.1 command creates a sub.pdf
C is correct. The interface fastEthernet 00.1 command creates a sub.pdfC is correct. The interface fastEthernet 00.1 command creates a sub.pdf
C is correct. The interface fastEthernet 00.1 command creates a sub.pdf
 
Beacuse ...deinococcus - thermus is a phylum of bacteria that are .pdf
Beacuse ...deinococcus - thermus is a phylum of bacteria that are .pdfBeacuse ...deinococcus - thermus is a phylum of bacteria that are .pdf
Beacuse ...deinococcus - thermus is a phylum of bacteria that are .pdf
 
Answera). DeletionGene D is deletedb). DuplicationThe genes.pdf
Answera). DeletionGene D is deletedb). DuplicationThe genes.pdfAnswera). DeletionGene D is deletedb). DuplicationThe genes.pdf
Answera). DeletionGene D is deletedb). DuplicationThe genes.pdf
 
Ans Cancer cells loss their growth control and multiply at uncontro.pdf
Ans Cancer cells loss their growth control and multiply at uncontro.pdfAns Cancer cells loss their growth control and multiply at uncontro.pdf
Ans Cancer cells loss their growth control and multiply at uncontro.pdf
 

Recently uploaded

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 

Recently uploaded (20)

Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
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.
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 

A sequence is an abstract data type in which elements appear in orde.pdf

  • 1. A sequence is an abstract data type in which elements appear in order. The elements may appear multiple times but in order. A bag is also an abstract data type but the elements are not in order. Elements can be added to bag but they cannot be removed from the bag. Thus deletion or removal of elements is an additional operation required by a sequence. Sequence can have following operations add(), remove(item), isEmpty() And Bag can have add(), isEmpty() only Solution A sequence is an abstract data type in which elements appear in order. The elements may appear multiple times but in order. A bag is also an abstract data type but the elements are not in order. Elements can be added to bag but they cannot be removed from the bag. Thus deletion or removal of elements is an additional operation required by a sequence. Sequence can have following operations add(), remove(item), isEmpty() And Bag can have add(), isEmpty() only