SlideShare a Scribd company logo
Write the functions add( ), delete( ), build( ), heapify( ) [swim up], sink( ) and heapSort( ) for a Min
Heap Data Structure. Create a .txt file containing a bunch of numbers. Read the input from there
and use the build( ) function to create a heap. Then ask the user to enter a command. A for adding
a new number, B for deleting, and S for sorting
Note: Write a simple python code for beginners. Use Python only.
TIA

More Related Content

More from abhaymedical2010

Question 2 In this question you will consider the developme.pdf
Question 2 In this question you will consider the developme.pdfQuestion 2 In this question you will consider the developme.pdf
Question 2 In this question you will consider the developme.pdf
abhaymedical2010
 
6512 Exercise 6311 Continued Let X1Xn be iid having.pdf
6512 Exercise 6311 Continued Let X1Xn be iid having.pdf6512 Exercise 6311 Continued Let X1Xn be iid having.pdf
6512 Exercise 6311 Continued Let X1Xn be iid having.pdf
abhaymedical2010
 
6 Section 42 problem 14 The article Modeling Sediment .pdf
6 Section 42 problem 14 The article Modeling Sediment .pdf6 Section 42 problem 14 The article Modeling Sediment .pdf
6 Section 42 problem 14 The article Modeling Sediment .pdf
abhaymedical2010
 
Nornal Distribution inivromm231523b312881294 b What.pdf
Nornal Distribution inivromm231523b312881294 b What.pdfNornal Distribution inivromm231523b312881294 b What.pdf
Nornal Distribution inivromm231523b312881294 b What.pdf
abhaymedical2010
 
On November 4 2022 Carine a taxpayer who will use the sin.pdf
On November 4 2022 Carine a taxpayer who will use the sin.pdfOn November 4 2022 Carine a taxpayer who will use the sin.pdf
On November 4 2022 Carine a taxpayer who will use the sin.pdf
abhaymedical2010
 
A patient has a fracture of the right wrist following a fall.pdf
A patient has a fracture of the right wrist following a fall.pdfA patient has a fracture of the right wrist following a fall.pdf
A patient has a fracture of the right wrist following a fall.pdf
abhaymedical2010
 
1 Hangisi stratejik ynetim srecinin aamalarndan deildir .pdf
1 Hangisi stratejik ynetim srecinin aamalarndan deildir .pdf1 Hangisi stratejik ynetim srecinin aamalarndan deildir .pdf
1 Hangisi stratejik ynetim srecinin aamalarndan deildir .pdf
abhaymedical2010
 
92 ABC Company purchased a 30 investment in XYZ Inc for .pdf
92 ABC Company purchased a 30 investment in XYZ Inc for .pdf92 ABC Company purchased a 30 investment in XYZ Inc for .pdf
92 ABC Company purchased a 30 investment in XYZ Inc for .pdf
abhaymedical2010
 
3 Create a function with def inflateS which takes as inp.pdf
3 Create a function with def inflateS which takes as inp.pdf3 Create a function with def inflateS which takes as inp.pdf
3 Create a function with def inflateS which takes as inp.pdf
abhaymedical2010
 
2 Can the function Fxy1ex2+y0x0y0otherwise be t.pdf
2 Can the function Fxy1ex2+y0x0y0otherwise be t.pdf2 Can the function Fxy1ex2+y0x0y0otherwise be t.pdf
2 Can the function Fxy1ex2+y0x0y0otherwise be t.pdf
abhaymedical2010
 
4 4 points Construct a max heap for the given array of el.pdf
4 4 points Construct a max heap for the given array of el.pdf4 4 points Construct a max heap for the given array of el.pdf
4 4 points Construct a max heap for the given array of el.pdf
abhaymedical2010
 
1 eTectbook and wiedla Ls ar Aocounts Mcoant Titles and Ex.pdf
1 eTectbook and wiedla Ls ar Aocounts Mcoant Titles and Ex.pdf1 eTectbook and wiedla Ls ar Aocounts Mcoant Titles and Ex.pdf
1 eTectbook and wiedla Ls ar Aocounts Mcoant Titles and Ex.pdf
abhaymedical2010
 
12 Angry Men filminden yola karak ana rolde gzlemlenen .pdf
12 Angry Men filminden yola karak ana rolde gzlemlenen .pdf12 Angry Men filminden yola karak ana rolde gzlemlenen .pdf
12 Angry Men filminden yola karak ana rolde gzlemlenen .pdf
abhaymedical2010
 
1 La aplicacin a gran escala de fertilizantes que contien.pdf
1  La aplicacin a gran escala de fertilizantes que contien.pdf1  La aplicacin a gran escala de fertilizantes que contien.pdf
1 La aplicacin a gran escala de fertilizantes que contien.pdf
abhaymedical2010
 
1 A doctor suspects that you might be infected with Trypano.pdf
1 A doctor suspects that you might be infected with Trypano.pdf1 A doctor suspects that you might be infected with Trypano.pdf
1 A doctor suspects that you might be infected with Trypano.pdf
abhaymedical2010
 

More from abhaymedical2010 (15)

Question 2 In this question you will consider the developme.pdf
Question 2 In this question you will consider the developme.pdfQuestion 2 In this question you will consider the developme.pdf
Question 2 In this question you will consider the developme.pdf
 
6512 Exercise 6311 Continued Let X1Xn be iid having.pdf
6512 Exercise 6311 Continued Let X1Xn be iid having.pdf6512 Exercise 6311 Continued Let X1Xn be iid having.pdf
6512 Exercise 6311 Continued Let X1Xn be iid having.pdf
 
6 Section 42 problem 14 The article Modeling Sediment .pdf
6 Section 42 problem 14 The article Modeling Sediment .pdf6 Section 42 problem 14 The article Modeling Sediment .pdf
6 Section 42 problem 14 The article Modeling Sediment .pdf
 
Nornal Distribution inivromm231523b312881294 b What.pdf
Nornal Distribution inivromm231523b312881294 b What.pdfNornal Distribution inivromm231523b312881294 b What.pdf
Nornal Distribution inivromm231523b312881294 b What.pdf
 
On November 4 2022 Carine a taxpayer who will use the sin.pdf
On November 4 2022 Carine a taxpayer who will use the sin.pdfOn November 4 2022 Carine a taxpayer who will use the sin.pdf
On November 4 2022 Carine a taxpayer who will use the sin.pdf
 
A patient has a fracture of the right wrist following a fall.pdf
A patient has a fracture of the right wrist following a fall.pdfA patient has a fracture of the right wrist following a fall.pdf
A patient has a fracture of the right wrist following a fall.pdf
 
1 Hangisi stratejik ynetim srecinin aamalarndan deildir .pdf
1 Hangisi stratejik ynetim srecinin aamalarndan deildir .pdf1 Hangisi stratejik ynetim srecinin aamalarndan deildir .pdf
1 Hangisi stratejik ynetim srecinin aamalarndan deildir .pdf
 
92 ABC Company purchased a 30 investment in XYZ Inc for .pdf
92 ABC Company purchased a 30 investment in XYZ Inc for .pdf92 ABC Company purchased a 30 investment in XYZ Inc for .pdf
92 ABC Company purchased a 30 investment in XYZ Inc for .pdf
 
3 Create a function with def inflateS which takes as inp.pdf
3 Create a function with def inflateS which takes as inp.pdf3 Create a function with def inflateS which takes as inp.pdf
3 Create a function with def inflateS which takes as inp.pdf
 
2 Can the function Fxy1ex2+y0x0y0otherwise be t.pdf
2 Can the function Fxy1ex2+y0x0y0otherwise be t.pdf2 Can the function Fxy1ex2+y0x0y0otherwise be t.pdf
2 Can the function Fxy1ex2+y0x0y0otherwise be t.pdf
 
4 4 points Construct a max heap for the given array of el.pdf
4 4 points Construct a max heap for the given array of el.pdf4 4 points Construct a max heap for the given array of el.pdf
4 4 points Construct a max heap for the given array of el.pdf
 
1 eTectbook and wiedla Ls ar Aocounts Mcoant Titles and Ex.pdf
1 eTectbook and wiedla Ls ar Aocounts Mcoant Titles and Ex.pdf1 eTectbook and wiedla Ls ar Aocounts Mcoant Titles and Ex.pdf
1 eTectbook and wiedla Ls ar Aocounts Mcoant Titles and Ex.pdf
 
12 Angry Men filminden yola karak ana rolde gzlemlenen .pdf
12 Angry Men filminden yola karak ana rolde gzlemlenen .pdf12 Angry Men filminden yola karak ana rolde gzlemlenen .pdf
12 Angry Men filminden yola karak ana rolde gzlemlenen .pdf
 
1 La aplicacin a gran escala de fertilizantes que contien.pdf
1  La aplicacin a gran escala de fertilizantes que contien.pdf1  La aplicacin a gran escala de fertilizantes que contien.pdf
1 La aplicacin a gran escala de fertilizantes que contien.pdf
 
1 A doctor suspects that you might be infected with Trypano.pdf
1 A doctor suspects that you might be infected with Trypano.pdf1 A doctor suspects that you might be infected with Trypano.pdf
1 A doctor suspects that you might be infected with Trypano.pdf
 

Recently uploaded

How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
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
 
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.
 
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
 
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
 
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
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
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
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
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
 
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
 

Recently uploaded (20)

How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
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...
 
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
 
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 ...
 
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
 
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
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.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
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
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
 
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
 

Write the functions add delete build heapify .pdf

  • 1. Write the functions add( ), delete( ), build( ), heapify( ) [swim up], sink( ) and heapSort( ) for a Min Heap Data Structure. Create a .txt file containing a bunch of numbers. Read the input from there and use the build( ) function to create a heap. Then ask the user to enter a command. A for adding a new number, B for deleting, and S for sorting Note: Write a simple python code for beginners. Use Python only. TIA