SlideShare a Scribd company logo
1 of 1
Download to read offline
Please use Python and answer both questions. Don't use the old version those are wrong. Thank
you
Exercise-1: (15 points) Develop a BinarySearchtree.py which can perform the following functions: -
Insert node to a tree - Perform In-order traversal - Perform Pre-order traversal - Perform Post-
order traversal - Search a node - Find the height of the tree - Find the height of a node - Given a
node, print all the successor. - Given a node, print all the predecessor. Exercise-2: (15 points)
Write a function to remove a node from a BST data structure? This function should consider all the
three cases: case-1: remove a leaf node, case-2: remove a node with one child and case-3:
remove a node with two children. Perform the time complexity for this function. Briefly explain?

More Related Content

More from aggarwalopticalsco

Please to write a Rebuttal essay on these points 1 IP laws .pdf
Please to write a Rebuttal essay on these points 1 IP laws .pdfPlease to write a Rebuttal essay on these points 1 IP laws .pdf
Please to write a Rebuttal essay on these points 1 IP laws .pdf
aggarwalopticalsco
 
Please tell me the correct answer for each question listed .pdf
Please tell me the correct answer for each question listed .pdfPlease tell me the correct answer for each question listed .pdf
Please tell me the correct answer for each question listed .pdf
aggarwalopticalsco
 
Please solve the TODO parts of the following probelm incl.pdf
Please solve the TODO parts of the following probelm  incl.pdfPlease solve the TODO parts of the following probelm  incl.pdf
Please solve the TODO parts of the following probelm incl.pdf
aggarwalopticalsco
 
Please solve the TODO parts include LinkedListcpph tem.pdf
Please solve the TODO parts  include LinkedListcpph tem.pdfPlease solve the TODO parts  include LinkedListcpph tem.pdf
Please solve the TODO parts include LinkedListcpph tem.pdf
aggarwalopticalsco
 
Please respond to AI by stating which element of expectanc.pdf
Please respond to AI by stating which element of expectanc.pdfPlease respond to AI by stating which element of expectanc.pdf
Please respond to AI by stating which element of expectanc.pdf
aggarwalopticalsco
 
please reference the work using the APA style and I dont wa.pdf
please reference the work using the APA style and I dont wa.pdfplease reference the work using the APA style and I dont wa.pdf
please reference the work using the APA style and I dont wa.pdf
aggarwalopticalsco
 
please read the steps below and it will tell you what we usi.pdf
please read the steps below and it will tell you what we usi.pdfplease read the steps below and it will tell you what we usi.pdf
please read the steps below and it will tell you what we usi.pdf
aggarwalopticalsco
 

More from aggarwalopticalsco (20)

Please to write a Rebuttal essay on these points 1 IP laws .pdf
Please to write a Rebuttal essay on these points 1 IP laws .pdfPlease to write a Rebuttal essay on these points 1 IP laws .pdf
Please to write a Rebuttal essay on these points 1 IP laws .pdf
 
Please type your asnwer for a better rating 4 Explain f.pdf
Please type your asnwer for a better rating    4 Explain f.pdfPlease type your asnwer for a better rating    4 Explain f.pdf
Please type your asnwer for a better rating 4 Explain f.pdf
 
Please tell me the correct answer for each question listed .pdf
Please tell me the correct answer for each question listed .pdfPlease tell me the correct answer for each question listed .pdf
Please tell me the correct answer for each question listed .pdf
 
Please solve the TODO parts of the following probelm incl.pdf
Please solve the TODO parts of the following probelm  incl.pdfPlease solve the TODO parts of the following probelm  incl.pdf
Please solve the TODO parts of the following probelm incl.pdf
 
Please solve the TODO parts include LinkedListcpph tem.pdf
Please solve the TODO parts  include LinkedListcpph tem.pdfPlease solve the TODO parts  include LinkedListcpph tem.pdf
Please solve the TODO parts include LinkedListcpph tem.pdf
 
Please solve the following problem Make a program that dete.pdf
Please solve the following problem Make a program that dete.pdfPlease solve the following problem Make a program that dete.pdf
Please solve the following problem Make a program that dete.pdf
 
please show steps Consider the function fxyzz968x63.pdf
please show steps Consider the function fxyzz968x63.pdfplease show steps Consider the function fxyzz968x63.pdf
please show steps Consider the function fxyzz968x63.pdf
 
please solve in Java language not in other language Instruct.pdf
please solve in Java language not in other language Instruct.pdfplease solve in Java language not in other language Instruct.pdf
please solve in Java language not in other language Instruct.pdf
 
please solve fast ND correctlyits urgent An animal that i.pdf
please solve fast ND correctlyits urgent An animal that i.pdfplease solve fast ND correctlyits urgent An animal that i.pdf
please solve fast ND correctlyits urgent An animal that i.pdf
 
please solve all parts as they are the same question but MCQ.pdf
please solve all parts as they are the same question but MCQ.pdfplease solve all parts as they are the same question but MCQ.pdf
please solve all parts as they are the same question but MCQ.pdf
 
Please show your calculations and complete the table 3 Co.pdf
Please show your calculations and complete the table  3 Co.pdfPlease show your calculations and complete the table  3 Co.pdf
Please show your calculations and complete the table 3 Co.pdf
 
Please show work on paper For the general loan of amount L t.pdf
Please show work on paper For the general loan of amount L t.pdfPlease show work on paper For the general loan of amount L t.pdf
Please show work on paper For the general loan of amount L t.pdf
 
please show work Rate of return Personal Finance Problem Ris.pdf
please show work Rate of return Personal Finance Problem Ris.pdfplease show work Rate of return Personal Finance Problem Ris.pdf
please show work Rate of return Personal Finance Problem Ris.pdf
 
Please show all steps and explain them Let X be a continuou.pdf
Please show all steps and explain them Let X be a continuou.pdfPlease show all steps and explain them Let X be a continuou.pdf
Please show all steps and explain them Let X be a continuou.pdf
 
Please represent the integer numbers in the following format.pdf
Please represent the integer numbers in the following format.pdfPlease represent the integer numbers in the following format.pdf
Please represent the integer numbers in the following format.pdf
 
Please respond to AI by stating which element of expectanc.pdf
Please respond to AI by stating which element of expectanc.pdfPlease respond to AI by stating which element of expectanc.pdf
Please respond to AI by stating which element of expectanc.pdf
 
please reference the work using the APA style and I dont wa.pdf
please reference the work using the APA style and I dont wa.pdfplease reference the work using the APA style and I dont wa.pdf
please reference the work using the APA style and I dont wa.pdf
 
please read the steps below and it will tell you what we usi.pdf
please read the steps below and it will tell you what we usi.pdfplease read the steps below and it will tell you what we usi.pdf
please read the steps below and it will tell you what we usi.pdf
 
Please show all necessary steps a Let 1XVarXpath d.pdf
Please show all necessary steps a Let 1XVarXpath d.pdfPlease show all necessary steps a Let 1XVarXpath d.pdf
Please show all necessary steps a Let 1XVarXpath d.pdf
 
please show solution in Mathematica A particle is undergoing.pdf
please show solution in Mathematica A particle is undergoing.pdfplease show solution in Mathematica A particle is undergoing.pdf
please show solution in Mathematica A particle is undergoing.pdf
 

Recently uploaded

BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
SoniaTolstoy
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
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)

BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
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
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 

Please use Python and answer both questions Dont use the o.pdf

  • 1. Please use Python and answer both questions. Don't use the old version those are wrong. Thank you Exercise-1: (15 points) Develop a BinarySearchtree.py which can perform the following functions: - Insert node to a tree - Perform In-order traversal - Perform Pre-order traversal - Perform Post- order traversal - Search a node - Find the height of the tree - Find the height of a node - Given a node, print all the successor. - Given a node, print all the predecessor. Exercise-2: (15 points) Write a function to remove a node from a BST data structure? This function should consider all the three cases: case-1: remove a leaf node, case-2: remove a node with one child and case-3: remove a node with two children. Perform the time complexity for this function. Briefly explain?