SlideShare a Scribd company logo
Priority queues may to implemented as linked lists kept in key order, or linked lists kept
unordered compare the cost for the implementation of the operation of Inserting a new key
Changing a key value Deleting the maximum Key We've implemented a FIFO queue With the
usual structures and algorithms. Now we add reverse links to each node. Does the Order of
queuing or dequeuing change?
Solution
1)Queue is a First In First out data structure and one of the way to implement is linked list with
order and unorder.
So, lets first talks aboit the order liked lists:
For example linked list is Increase order that highest element is at first and least element is at
last. and deletion of elements takes place at last and inserting of elements is taking at first we can
think in reverse also.
To insert an element we need to travrse all the list to the required osition to insert the element , If
N elements are in the list then for AVERAGE and Worst time cases takes O(N) time and for
Deletion also takes O(1) time whcich is constant.
and in the case of changing any elements it is same as the inserting element becase in first step
element needs to be found and in second step value neeeds to be changed.
IN UNORDER list case The INSERTION and DELETION takes O(1) time only. and for
changeing it is O(N) in average and worst time complexities.
2)No it depends on the way we does those operations.
I mean that If to wish to do insertion at last and deletion at first and vice-verse that upto you to
code. but if links are changed all the meaning of your first code also changes.
I think you got my point.

More Related Content

Similar to Priority queues may to implemented as linked lists kept in key or.pdf

Ijcse13 05-01-048
Ijcse13 05-01-048Ijcse13 05-01-048
Ijcse13 05-01-048vital vital
 
Ijcse13 05-01-048
Ijcse13 05-01-048Ijcse13 05-01-048
Ijcse13 05-01-048vital vital
 
Linkedlists
LinkedlistsLinkedlists
Linkedlists
Rajendran
 
unit 5 stack & queue.ppt
unit 5 stack & queue.pptunit 5 stack & queue.ppt
unit 5 stack & queue.ppt
SeethaDinesh
 
advanced searching and sorting.pdf
advanced searching and sorting.pdfadvanced searching and sorting.pdf
advanced searching and sorting.pdf
haramaya university
 
List Data Structure
List Data StructureList Data Structure
List Data Structure
Zidny Nafan
 
Data Structures(Part 1)
Data Structures(Part 1)Data Structures(Part 1)
Data Structures(Part 1)
SURBHI SAROHA
 
Sy ds -I
Sy ds -ISy ds -I
Sy ds -I
Sy ds -ISy ds -I
Sy ds i
Sy ds iSy ds i
Lecture3
Lecture3Lecture3
Lecture3
Muhammad Zubair
 
Lecture3
Lecture3Lecture3
Lecture3
Muhammad Zubair
 
Data Structures_ Sorting & Searching
Data Structures_ Sorting & SearchingData Structures_ Sorting & Searching
Data Structures_ Sorting & Searching
ThenmozhiK5
 
DS - Unit 2 FINAL (2).pptx
DS - Unit 2 FINAL (2).pptxDS - Unit 2 FINAL (2).pptx
DS - Unit 2 FINAL (2).pptx
prakashvs7
 
Answersa) It is more efficient to delete the last node in an array.pdf
Answersa) It is more efficient to delete the last node in an array.pdfAnswersa) It is more efficient to delete the last node in an array.pdf
Answersa) It is more efficient to delete the last node in an array.pdf
anilgoelslg
 
day 13.pptx
day 13.pptxday 13.pptx
day 13.pptx
codewavecommunity44
 
Sort Characters in a Python String Alphabetically
Sort Characters in a Python String AlphabeticallySort Characters in a Python String Alphabetically
Sort Characters in a Python String Alphabetically
Kal Bartal
 
Linked list (1).pptx
Linked list (1).pptxLinked list (1).pptx
Linked list (1).pptx
rajveersingh643731
 

Similar to Priority queues may to implemented as linked lists kept in key or.pdf (20)

Ijcse13 05-01-048
Ijcse13 05-01-048Ijcse13 05-01-048
Ijcse13 05-01-048
 
Ijcse13 05-01-048
Ijcse13 05-01-048Ijcse13 05-01-048
Ijcse13 05-01-048
 
Linkedlists
LinkedlistsLinkedlists
Linkedlists
 
unit 5 stack & queue.ppt
unit 5 stack & queue.pptunit 5 stack & queue.ppt
unit 5 stack & queue.ppt
 
advanced searching and sorting.pdf
advanced searching and sorting.pdfadvanced searching and sorting.pdf
advanced searching and sorting.pdf
 
List Data Structure
List Data StructureList Data Structure
List Data Structure
 
List data structure
List data structure List data structure
List data structure
 
Data Structures(Part 1)
Data Structures(Part 1)Data Structures(Part 1)
Data Structures(Part 1)
 
Sy ds -I
Sy ds -ISy ds -I
Sy ds -I
 
Sy ds -I
Sy ds -ISy ds -I
Sy ds -I
 
Sy ds i
Sy ds iSy ds i
Sy ds i
 
Unit v data structure-converted
Unit  v data structure-convertedUnit  v data structure-converted
Unit v data structure-converted
 
Lecture3
Lecture3Lecture3
Lecture3
 
Lecture3
Lecture3Lecture3
Lecture3
 
Data Structures_ Sorting & Searching
Data Structures_ Sorting & SearchingData Structures_ Sorting & Searching
Data Structures_ Sorting & Searching
 
DS - Unit 2 FINAL (2).pptx
DS - Unit 2 FINAL (2).pptxDS - Unit 2 FINAL (2).pptx
DS - Unit 2 FINAL (2).pptx
 
Answersa) It is more efficient to delete the last node in an array.pdf
Answersa) It is more efficient to delete the last node in an array.pdfAnswersa) It is more efficient to delete the last node in an array.pdf
Answersa) It is more efficient to delete the last node in an array.pdf
 
day 13.pptx
day 13.pptxday 13.pptx
day 13.pptx
 
Sort Characters in a Python String Alphabetically
Sort Characters in a Python String AlphabeticallySort Characters in a Python String Alphabetically
Sort Characters in a Python String Alphabetically
 
Linked list (1).pptx
Linked list (1).pptxLinked list (1).pptx
Linked list (1).pptx
 

More from ederstevensc52755

GENERAL LEDGERName BANK ACCOUNTAcct No. 100DateDetailsPo.pdf
GENERAL LEDGERName BANK ACCOUNTAcct No. 100DateDetailsPo.pdfGENERAL LEDGERName BANK ACCOUNTAcct No. 100DateDetailsPo.pdf
GENERAL LEDGERName BANK ACCOUNTAcct No. 100DateDetailsPo.pdf
ederstevensc52755
 
Does the rate of diffusion change over time Does the rat.pdf
Does the rate of diffusion change over time   Does the rat.pdfDoes the rate of diffusion change over time   Does the rat.pdf
Does the rate of diffusion change over time Does the rat.pdf
ederstevensc52755
 
Ellen baked 112 cookies and shared them equally with her 23 classmat.pdf
Ellen baked 112 cookies and shared them equally with her 23 classmat.pdfEllen baked 112 cookies and shared them equally with her 23 classmat.pdf
Ellen baked 112 cookies and shared them equally with her 23 classmat.pdf
ederstevensc52755
 
Computing Change C program Computing Change Write a program p3.c th.pdf
Computing Change C program Computing Change  Write a program p3.c th.pdfComputing Change C program Computing Change  Write a program p3.c th.pdf
Computing Change C program Computing Change Write a program p3.c th.pdf
ederstevensc52755
 
Compare the nurse cells (Sertoli cells) in the mammalian testis with.pdf
Compare the nurse cells (Sertoli cells) in the mammalian testis with.pdfCompare the nurse cells (Sertoli cells) in the mammalian testis with.pdf
Compare the nurse cells (Sertoli cells) in the mammalian testis with.pdf
ederstevensc52755
 
Below is a mutant Drosophila cuticle. What class (ex. segment polari.pdf
Below is a mutant Drosophila cuticle. What class (ex. segment polari.pdfBelow is a mutant Drosophila cuticle. What class (ex. segment polari.pdf
Below is a mutant Drosophila cuticle. What class (ex. segment polari.pdf
ederstevensc52755
 
An _ is found on the tRNA molecule and has the complementary bases to.pdf
An _ is found on the tRNA molecule and has the complementary bases to.pdfAn _ is found on the tRNA molecule and has the complementary bases to.pdf
An _ is found on the tRNA molecule and has the complementary bases to.pdf
ederstevensc52755
 
A psychiatrist wants to test the impact of a new drug designed to in.pdf
A psychiatrist wants to test the impact of a new drug designed to in.pdfA psychiatrist wants to test the impact of a new drug designed to in.pdf
A psychiatrist wants to test the impact of a new drug designed to in.pdf
ederstevensc52755
 
With respect to accounting for inventories, which of the following i.pdf
With respect to accounting for inventories, which of the following i.pdfWith respect to accounting for inventories, which of the following i.pdf
With respect to accounting for inventories, which of the following i.pdf
ederstevensc52755
 
Why would it be advantageous to be able to become an endospore if you.pdf
Why would it be advantageous to be able to become an endospore if you.pdfWhy would it be advantageous to be able to become an endospore if you.pdf
Why would it be advantageous to be able to become an endospore if you.pdf
ederstevensc52755
 
What is the protocol that can be used to create VPN connections betw.pdf
What is the protocol that can be used to create VPN connections betw.pdfWhat is the protocol that can be used to create VPN connections betw.pdf
What is the protocol that can be used to create VPN connections betw.pdf
ederstevensc52755
 
What factor has held up the development of an Intermediate Moisture .pdf
What factor has held up the development of an Intermediate Moisture .pdfWhat factor has held up the development of an Intermediate Moisture .pdf
What factor has held up the development of an Intermediate Moisture .pdf
ederstevensc52755
 
What is black holeSolutionA black hole is a region in space w.pdf
What is black holeSolutionA black hole is a region in space w.pdfWhat is black holeSolutionA black hole is a region in space w.pdf
What is black holeSolutionA black hole is a region in space w.pdf
ederstevensc52755
 
We are interested in determining whether scale traits for the Rio Gr.pdf
We are interested in determining whether scale traits for the Rio Gr.pdfWe are interested in determining whether scale traits for the Rio Gr.pdf
We are interested in determining whether scale traits for the Rio Gr.pdf
ederstevensc52755
 
The Reynolds number, pVDmu is a very Important parameter In fluid me.pdf
The Reynolds number, pVDmu is a very Important parameter In fluid me.pdfThe Reynolds number, pVDmu is a very Important parameter In fluid me.pdf
The Reynolds number, pVDmu is a very Important parameter In fluid me.pdf
ederstevensc52755
 
The respiratory gases of animals are. oxygen and nitrogen.nitrog.pdf
The respiratory gases of animals are. oxygen and nitrogen.nitrog.pdfThe respiratory gases of animals are. oxygen and nitrogen.nitrog.pdf
The respiratory gases of animals are. oxygen and nitrogen.nitrog.pdf
ederstevensc52755
 
The highest concentration of power regarding US monetary policy rest.pdf
The highest concentration of power regarding US monetary policy rest.pdfThe highest concentration of power regarding US monetary policy rest.pdf
The highest concentration of power regarding US monetary policy rest.pdf
ederstevensc52755
 
2.) Explain the originevolution of viruses by these hypotheses red.pdf
2.) Explain the originevolution of viruses by these hypotheses red.pdf2.) Explain the originevolution of viruses by these hypotheses red.pdf
2.) Explain the originevolution of viruses by these hypotheses red.pdf
ederstevensc52755
 
Suppose 13 of American adults believe that the highest priority of .pdf
Suppose 13 of American adults believe that the highest priority of .pdfSuppose 13 of American adults believe that the highest priority of .pdf
Suppose 13 of American adults believe that the highest priority of .pdf
ederstevensc52755
 
Revised QuestionThe entire content of the page has been enclosed .pdf
Revised QuestionThe entire content of the page has been enclosed .pdfRevised QuestionThe entire content of the page has been enclosed .pdf
Revised QuestionThe entire content of the page has been enclosed .pdf
ederstevensc52755
 

More from ederstevensc52755 (20)

GENERAL LEDGERName BANK ACCOUNTAcct No. 100DateDetailsPo.pdf
GENERAL LEDGERName BANK ACCOUNTAcct No. 100DateDetailsPo.pdfGENERAL LEDGERName BANK ACCOUNTAcct No. 100DateDetailsPo.pdf
GENERAL LEDGERName BANK ACCOUNTAcct No. 100DateDetailsPo.pdf
 
Does the rate of diffusion change over time Does the rat.pdf
Does the rate of diffusion change over time   Does the rat.pdfDoes the rate of diffusion change over time   Does the rat.pdf
Does the rate of diffusion change over time Does the rat.pdf
 
Ellen baked 112 cookies and shared them equally with her 23 classmat.pdf
Ellen baked 112 cookies and shared them equally with her 23 classmat.pdfEllen baked 112 cookies and shared them equally with her 23 classmat.pdf
Ellen baked 112 cookies and shared them equally with her 23 classmat.pdf
 
Computing Change C program Computing Change Write a program p3.c th.pdf
Computing Change C program Computing Change  Write a program p3.c th.pdfComputing Change C program Computing Change  Write a program p3.c th.pdf
Computing Change C program Computing Change Write a program p3.c th.pdf
 
Compare the nurse cells (Sertoli cells) in the mammalian testis with.pdf
Compare the nurse cells (Sertoli cells) in the mammalian testis with.pdfCompare the nurse cells (Sertoli cells) in the mammalian testis with.pdf
Compare the nurse cells (Sertoli cells) in the mammalian testis with.pdf
 
Below is a mutant Drosophila cuticle. What class (ex. segment polari.pdf
Below is a mutant Drosophila cuticle. What class (ex. segment polari.pdfBelow is a mutant Drosophila cuticle. What class (ex. segment polari.pdf
Below is a mutant Drosophila cuticle. What class (ex. segment polari.pdf
 
An _ is found on the tRNA molecule and has the complementary bases to.pdf
An _ is found on the tRNA molecule and has the complementary bases to.pdfAn _ is found on the tRNA molecule and has the complementary bases to.pdf
An _ is found on the tRNA molecule and has the complementary bases to.pdf
 
A psychiatrist wants to test the impact of a new drug designed to in.pdf
A psychiatrist wants to test the impact of a new drug designed to in.pdfA psychiatrist wants to test the impact of a new drug designed to in.pdf
A psychiatrist wants to test the impact of a new drug designed to in.pdf
 
With respect to accounting for inventories, which of the following i.pdf
With respect to accounting for inventories, which of the following i.pdfWith respect to accounting for inventories, which of the following i.pdf
With respect to accounting for inventories, which of the following i.pdf
 
Why would it be advantageous to be able to become an endospore if you.pdf
Why would it be advantageous to be able to become an endospore if you.pdfWhy would it be advantageous to be able to become an endospore if you.pdf
Why would it be advantageous to be able to become an endospore if you.pdf
 
What is the protocol that can be used to create VPN connections betw.pdf
What is the protocol that can be used to create VPN connections betw.pdfWhat is the protocol that can be used to create VPN connections betw.pdf
What is the protocol that can be used to create VPN connections betw.pdf
 
What factor has held up the development of an Intermediate Moisture .pdf
What factor has held up the development of an Intermediate Moisture .pdfWhat factor has held up the development of an Intermediate Moisture .pdf
What factor has held up the development of an Intermediate Moisture .pdf
 
What is black holeSolutionA black hole is a region in space w.pdf
What is black holeSolutionA black hole is a region in space w.pdfWhat is black holeSolutionA black hole is a region in space w.pdf
What is black holeSolutionA black hole is a region in space w.pdf
 
We are interested in determining whether scale traits for the Rio Gr.pdf
We are interested in determining whether scale traits for the Rio Gr.pdfWe are interested in determining whether scale traits for the Rio Gr.pdf
We are interested in determining whether scale traits for the Rio Gr.pdf
 
The Reynolds number, pVDmu is a very Important parameter In fluid me.pdf
The Reynolds number, pVDmu is a very Important parameter In fluid me.pdfThe Reynolds number, pVDmu is a very Important parameter In fluid me.pdf
The Reynolds number, pVDmu is a very Important parameter In fluid me.pdf
 
The respiratory gases of animals are. oxygen and nitrogen.nitrog.pdf
The respiratory gases of animals are. oxygen and nitrogen.nitrog.pdfThe respiratory gases of animals are. oxygen and nitrogen.nitrog.pdf
The respiratory gases of animals are. oxygen and nitrogen.nitrog.pdf
 
The highest concentration of power regarding US monetary policy rest.pdf
The highest concentration of power regarding US monetary policy rest.pdfThe highest concentration of power regarding US monetary policy rest.pdf
The highest concentration of power regarding US monetary policy rest.pdf
 
2.) Explain the originevolution of viruses by these hypotheses red.pdf
2.) Explain the originevolution of viruses by these hypotheses red.pdf2.) Explain the originevolution of viruses by these hypotheses red.pdf
2.) Explain the originevolution of viruses by these hypotheses red.pdf
 
Suppose 13 of American adults believe that the highest priority of .pdf
Suppose 13 of American adults believe that the highest priority of .pdfSuppose 13 of American adults believe that the highest priority of .pdf
Suppose 13 of American adults believe that the highest priority of .pdf
 
Revised QuestionThe entire content of the page has been enclosed .pdf
Revised QuestionThe entire content of the page has been enclosed .pdfRevised QuestionThe entire content of the page has been enclosed .pdf
Revised QuestionThe entire content of the page has been enclosed .pdf
 

Recently uploaded

Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
JEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questionsJEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questions
ShivajiThube2
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
Krisztián Száraz
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
DhatriParmar
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 

Recently uploaded (20)

Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
JEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questionsJEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questions
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 

Priority queues may to implemented as linked lists kept in key or.pdf

  • 1. Priority queues may to implemented as linked lists kept in key order, or linked lists kept unordered compare the cost for the implementation of the operation of Inserting a new key Changing a key value Deleting the maximum Key We've implemented a FIFO queue With the usual structures and algorithms. Now we add reverse links to each node. Does the Order of queuing or dequeuing change? Solution 1)Queue is a First In First out data structure and one of the way to implement is linked list with order and unorder. So, lets first talks aboit the order liked lists: For example linked list is Increase order that highest element is at first and least element is at last. and deletion of elements takes place at last and inserting of elements is taking at first we can think in reverse also. To insert an element we need to travrse all the list to the required osition to insert the element , If N elements are in the list then for AVERAGE and Worst time cases takes O(N) time and for Deletion also takes O(1) time whcich is constant. and in the case of changing any elements it is same as the inserting element becase in first step element needs to be found and in second step value neeeds to be changed. IN UNORDER list case The INSERTION and DELETION takes O(1) time only. and for changeing it is O(N) in average and worst time complexities. 2)No it depends on the way we does those operations. I mean that If to wish to do insertion at last and deletion at first and vice-verse that upto you to code. but if links are changed all the meaning of your first code also changes. I think you got my point.