SlideShare a Scribd company logo
1 of 15
Answer the question
• Consider the following rooted tree with the vertex P
labeled as The order in which the nodes are visited
during in-order traversal is
•
(A) SQPTRWUV
(B) SQPTURWV
(C) SQPTWUVR
(D) SQPTRUWV
Walchand Institute of Technology, Solapur 1
Answer the question
• Consider the following rooted tree with the vertex P
labeled as The order in which the nodes are visited
during in-order traversal is
•
(A) SQPTRWUV
(B) SQPTURWV
(C) SQPTWUVR
(D) SQPTRUWV
Walchand Institute of Technology, Solapur 2
GATE question
Consider the following New-order strategy for traversing a binary tree: Visit the
root; Visit the right sub tree using New-order; Visit the left sub tree using New-
order; The New-order traversal of the expression tree corresponding to the reverse
polish expression 3 4 * 5 - 2 ˆ 6 7 * 1 + - is given by: (GATE CS 2016 )
(a) + – 1 6 7 * 2 ˆ 5 – 3 4 *
(b) – + 1 * 6 7 ˆ 2 – 5 * 3 4
(c) – + 1 * 7 6 ˆ 2 – 5 * 4 3
(d) 1 7 6 * + 2 5 4 3 * – ˆ –
Walchand Institute of Technology, Solapur 3
GATE question
New-order strategy for traversing a binary tree:
• Visit the root; Root
• Visit the right sub tree using New-order; R
• Visit the left sub tree using New-order; L
• (Root, R,L)
The New-order traversal of the expression tree corresponding to the reverse
polish expression 3 4 * 5 - 2 ˆ 6 7 * 1 + -
Walchand Institute of Technology, Solapur 4
GATE question
3 4 * 5 - 2 ˆ 6 7 * 1 + -
L R Root
Walchand Institute of Technology, Solapur 5
GATE question
3 4 * 5 - 2 ˆ 6 7 * 1 + -
L R Root
Walchand Institute of Technology, Solapur 6
GATE question
34* 5 - 2 ˆ 6 7 * 1 + -
L R Root
Walchand Institute of Technology, Solapur 7
GATE question
34*5- 2 ˆ 6 7 * 1 + -
L R Root
Walchand Institute of Technology, Solapur 8
GATE question
34*5- 2ˆ 6 7 * 1 + -
L R Root
Walchand Institute of Technology, Solapur 9
GATE question
34*5- 2ˆ 6 7 * 1 + -
L R Root
Walchand Institute of Technology, Solapur 10
GATE question
34*5- 2ˆ 6 7* 1 + -
L Root R
Walchand Institute of Technology, Solapur 11
GATE question
34*5- 2ˆ 6 7*1+ -
L R Root
Walchand Institute of Technology, Solapur 12
GATE question
New-order strategy for traversing a binary tree:
• Visit the root; Root
• Visit the right sub tree using New-order; R
• Visit the left sub tree using New-order; L
• (Root, R,L)
(a) + – 1 6 7 * 2 ˆ 5 – 3 4 *
(b) – + 1 * 6 7 ˆ 2 – 5 * 3 4
(c) – + 1 * 7 6 ˆ 2 – 5 * 4 3
(d) 1 7 6 * + 2 5 4 3 * – ˆ –
Walchand Institute of Technology, Solapur 13
GATE question
New-order strategy for traversing a binary tree:
• Visit the root; Root
• Visit the right sub tree using New-order; R
• Visit the left sub tree using New-order; L
• (Root, R,L)
(a) + – 1 6 7 * 2 ˆ 5 – 3 4 * X
(b) – + 1 * 6 7 ˆ 2 – 5 * 3 4
(c) – + 1 * 7 6 ˆ 2 – 5 * 4 3
(d) 1 7 6 * + 2 5 4 3 * – ˆ – X
Walchand Institute of Technology, Solapur 14
GATE question
Consider the following New-order strategy for traversing a binary tree: Visit the root; Visit the
right subtree using New-order; Visit the left subtree using New-order; The New-order
traversal of the expression tree corresponding to the reverse polish expression
3 4 * 5 - 2 ˆ 6 7 * 1 + - is given by
(a) + – 1 6 7 * 2 ˆ 5 – 3 4 *
(b) – + 1 * 6 7 ˆ 2 – 5 * 3 4
(c) – + 1 * 7 6 ˆ 2 – 5 * 4 3
(d) 1 7 6 * + 2 5 4 3 * – ˆ – Ans : (C) – + 1 * 7 6 ˆ 2 – 5 * 4 3.
Walchand Institute of Technology, Solapur 15

More Related Content

Recently uploaded

Raashid final report on Embedded Systems
Raashid final report on Embedded SystemsRaashid final report on Embedded Systems
Raashid final report on Embedded SystemsRaashidFaiyazSheikh
 
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdflitvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdfAlexander Litvinenko
 
Electrostatic field in a coaxial transmission line
Electrostatic field in a coaxial transmission lineElectrostatic field in a coaxial transmission line
Electrostatic field in a coaxial transmission lineJulioCesarSalazarHer1
 
AI in Healthcare Innovative use cases and applications.pdf
AI in Healthcare Innovative use cases and applications.pdfAI in Healthcare Innovative use cases and applications.pdf
AI in Healthcare Innovative use cases and applications.pdfmahaffeycheryld
 
Introduction to Heat Exchangers: Principle, Types and Applications
Introduction to Heat Exchangers: Principle, Types and ApplicationsIntroduction to Heat Exchangers: Principle, Types and Applications
Introduction to Heat Exchangers: Principle, Types and ApplicationsKineticEngineeringCo
 
Quiz application system project report..pdf
Quiz application system project report..pdfQuiz application system project report..pdf
Quiz application system project report..pdfKamal Acharya
 
Low rpm Generator for efficient energy harnessing from a two stage wind turbine
Low rpm Generator for efficient energy harnessing from a two stage wind turbineLow rpm Generator for efficient energy harnessing from a two stage wind turbine
Low rpm Generator for efficient energy harnessing from a two stage wind turbineAftabkhan575376
 
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas SachpazisSeismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas SachpazisDr.Costas Sachpazis
 
Theory for How to calculation capacitor bank
Theory for How to calculation capacitor bankTheory for How to calculation capacitor bank
Theory for How to calculation capacitor banktawat puangthong
 
Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1T.D. Shashikala
 
Interfacing Analog to Digital Data Converters ee3404.pdf
Interfacing Analog to Digital Data Converters ee3404.pdfInterfacing Analog to Digital Data Converters ee3404.pdf
Interfacing Analog to Digital Data Converters ee3404.pdfragupathi90
 
Introduction to Arduino Programming: Features of Arduino
Introduction to Arduino Programming: Features of ArduinoIntroduction to Arduino Programming: Features of Arduino
Introduction to Arduino Programming: Features of ArduinoAbhimanyu Sangale
 
Introduction to Artificial Intelligence and History of AI
Introduction to Artificial Intelligence and History of AIIntroduction to Artificial Intelligence and History of AI
Introduction to Artificial Intelligence and History of AISheetal Jain
 
"United Nations Park" Site Visit Report.
"United Nations Park" Site  Visit Report."United Nations Park" Site  Visit Report.
"United Nations Park" Site Visit Report.MdManikurRahman
 
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024EMMANUELLEFRANCEHELI
 
How to Design and spec harmonic filter.pdf
How to Design and spec harmonic filter.pdfHow to Design and spec harmonic filter.pdf
How to Design and spec harmonic filter.pdftawat puangthong
 
Piping and instrumentation diagram p.pdf
Piping and instrumentation diagram p.pdfPiping and instrumentation diagram p.pdf
Piping and instrumentation diagram p.pdfAshrafRagab14
 
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdfInstruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdfEr.Sonali Nasikkar
 
Filters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility ApplicationsFilters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility ApplicationsMathias Magdowski
 
Research Methodolgy & Intellectual Property Rights Series 2
Research Methodolgy & Intellectual Property Rights Series 2Research Methodolgy & Intellectual Property Rights Series 2
Research Methodolgy & Intellectual Property Rights Series 2T.D. Shashikala
 

Recently uploaded (20)

Raashid final report on Embedded Systems
Raashid final report on Embedded SystemsRaashid final report on Embedded Systems
Raashid final report on Embedded Systems
 
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdflitvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
litvinenko_Henry_Intrusion_Hong-Kong_2024.pdf
 
Electrostatic field in a coaxial transmission line
Electrostatic field in a coaxial transmission lineElectrostatic field in a coaxial transmission line
Electrostatic field in a coaxial transmission line
 
AI in Healthcare Innovative use cases and applications.pdf
AI in Healthcare Innovative use cases and applications.pdfAI in Healthcare Innovative use cases and applications.pdf
AI in Healthcare Innovative use cases and applications.pdf
 
Introduction to Heat Exchangers: Principle, Types and Applications
Introduction to Heat Exchangers: Principle, Types and ApplicationsIntroduction to Heat Exchangers: Principle, Types and Applications
Introduction to Heat Exchangers: Principle, Types and Applications
 
Quiz application system project report..pdf
Quiz application system project report..pdfQuiz application system project report..pdf
Quiz application system project report..pdf
 
Low rpm Generator for efficient energy harnessing from a two stage wind turbine
Low rpm Generator for efficient energy harnessing from a two stage wind turbineLow rpm Generator for efficient energy harnessing from a two stage wind turbine
Low rpm Generator for efficient energy harnessing from a two stage wind turbine
 
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas SachpazisSeismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
 
Theory for How to calculation capacitor bank
Theory for How to calculation capacitor bankTheory for How to calculation capacitor bank
Theory for How to calculation capacitor bank
 
Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1
 
Interfacing Analog to Digital Data Converters ee3404.pdf
Interfacing Analog to Digital Data Converters ee3404.pdfInterfacing Analog to Digital Data Converters ee3404.pdf
Interfacing Analog to Digital Data Converters ee3404.pdf
 
Introduction to Arduino Programming: Features of Arduino
Introduction to Arduino Programming: Features of ArduinoIntroduction to Arduino Programming: Features of Arduino
Introduction to Arduino Programming: Features of Arduino
 
Introduction to Artificial Intelligence and History of AI
Introduction to Artificial Intelligence and History of AIIntroduction to Artificial Intelligence and History of AI
Introduction to Artificial Intelligence and History of AI
 
"United Nations Park" Site Visit Report.
"United Nations Park" Site  Visit Report."United Nations Park" Site  Visit Report.
"United Nations Park" Site Visit Report.
 
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
NEWLETTER FRANCE HELICES/ SDS SURFACE DRIVES - MAY 2024
 
How to Design and spec harmonic filter.pdf
How to Design and spec harmonic filter.pdfHow to Design and spec harmonic filter.pdf
How to Design and spec harmonic filter.pdf
 
Piping and instrumentation diagram p.pdf
Piping and instrumentation diagram p.pdfPiping and instrumentation diagram p.pdf
Piping and instrumentation diagram p.pdf
 
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdfInstruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
 
Filters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility ApplicationsFilters for Electromagnetic Compatibility Applications
Filters for Electromagnetic Compatibility Applications
 
Research Methodolgy & Intellectual Property Rights Series 2
Research Methodolgy & Intellectual Property Rights Series 2Research Methodolgy & Intellectual Property Rights Series 2
Research Methodolgy & Intellectual Property Rights Series 2
 

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Ds gate tree ppt

  • 1. Answer the question • Consider the following rooted tree with the vertex P labeled as The order in which the nodes are visited during in-order traversal is • (A) SQPTRWUV (B) SQPTURWV (C) SQPTWUVR (D) SQPTRUWV Walchand Institute of Technology, Solapur 1
  • 2. Answer the question • Consider the following rooted tree with the vertex P labeled as The order in which the nodes are visited during in-order traversal is • (A) SQPTRWUV (B) SQPTURWV (C) SQPTWUVR (D) SQPTRUWV Walchand Institute of Technology, Solapur 2
  • 3. GATE question Consider the following New-order strategy for traversing a binary tree: Visit the root; Visit the right sub tree using New-order; Visit the left sub tree using New- order; The New-order traversal of the expression tree corresponding to the reverse polish expression 3 4 * 5 - 2 ˆ 6 7 * 1 + - is given by: (GATE CS 2016 ) (a) + – 1 6 7 * 2 ˆ 5 – 3 4 * (b) – + 1 * 6 7 ˆ 2 – 5 * 3 4 (c) – + 1 * 7 6 ˆ 2 – 5 * 4 3 (d) 1 7 6 * + 2 5 4 3 * – ˆ – Walchand Institute of Technology, Solapur 3
  • 4. GATE question New-order strategy for traversing a binary tree: • Visit the root; Root • Visit the right sub tree using New-order; R • Visit the left sub tree using New-order; L • (Root, R,L) The New-order traversal of the expression tree corresponding to the reverse polish expression 3 4 * 5 - 2 ˆ 6 7 * 1 + - Walchand Institute of Technology, Solapur 4
  • 5. GATE question 3 4 * 5 - 2 ˆ 6 7 * 1 + - L R Root Walchand Institute of Technology, Solapur 5
  • 6. GATE question 3 4 * 5 - 2 ˆ 6 7 * 1 + - L R Root Walchand Institute of Technology, Solapur 6
  • 7. GATE question 34* 5 - 2 ˆ 6 7 * 1 + - L R Root Walchand Institute of Technology, Solapur 7
  • 8. GATE question 34*5- 2 ˆ 6 7 * 1 + - L R Root Walchand Institute of Technology, Solapur 8
  • 9. GATE question 34*5- 2ˆ 6 7 * 1 + - L R Root Walchand Institute of Technology, Solapur 9
  • 10. GATE question 34*5- 2ˆ 6 7 * 1 + - L R Root Walchand Institute of Technology, Solapur 10
  • 11. GATE question 34*5- 2ˆ 6 7* 1 + - L Root R Walchand Institute of Technology, Solapur 11
  • 12. GATE question 34*5- 2ˆ 6 7*1+ - L R Root Walchand Institute of Technology, Solapur 12
  • 13. GATE question New-order strategy for traversing a binary tree: • Visit the root; Root • Visit the right sub tree using New-order; R • Visit the left sub tree using New-order; L • (Root, R,L) (a) + – 1 6 7 * 2 ˆ 5 – 3 4 * (b) – + 1 * 6 7 ˆ 2 – 5 * 3 4 (c) – + 1 * 7 6 ˆ 2 – 5 * 4 3 (d) 1 7 6 * + 2 5 4 3 * – ˆ – Walchand Institute of Technology, Solapur 13
  • 14. GATE question New-order strategy for traversing a binary tree: • Visit the root; Root • Visit the right sub tree using New-order; R • Visit the left sub tree using New-order; L • (Root, R,L) (a) + – 1 6 7 * 2 ˆ 5 – 3 4 * X (b) – + 1 * 6 7 ˆ 2 – 5 * 3 4 (c) – + 1 * 7 6 ˆ 2 – 5 * 4 3 (d) 1 7 6 * + 2 5 4 3 * – ˆ – X Walchand Institute of Technology, Solapur 14
  • 15. GATE question Consider the following New-order strategy for traversing a binary tree: Visit the root; Visit the right subtree using New-order; Visit the left subtree using New-order; The New-order traversal of the expression tree corresponding to the reverse polish expression 3 4 * 5 - 2 ˆ 6 7 * 1 + - is given by (a) + – 1 6 7 * 2 ˆ 5 – 3 4 * (b) – + 1 * 6 7 ˆ 2 – 5 * 3 4 (c) – + 1 * 7 6 ˆ 2 – 5 * 4 3 (d) 1 7 6 * + 2 5 4 3 * – ˆ – Ans : (C) – + 1 * 7 6 ˆ 2 – 5 * 4 3. Walchand Institute of Technology, Solapur 15