SlideShare a Scribd company logo
1 of 1
Download to read offline
Solution
:
Inorder traversal: It will consider left child root, and right child.
Inorder Sequence: DHBEIAJFCGK
Explanation:
Root node is A.
left child of A is B.
It has children. So move B into stack.
stack |B|
Travel to the left child of B.It is D.
D has children. So move D into stack.
stack |D|B|
Travel to the left child of D. There is no left
child for D.
So traverse Back. pop the stack and print.
Sequence: D
stack |B|
move to the right child of D. It is H. it is a leaf.
So print it.
Sequence: DH
So traverse Back. pop the stack and print.
Sequence: DHB
stack empty
similarly process entire tree.

More Related Content

More from apleather

Form1.csusing System; using System.Collections.Generic; using .pdf
Form1.csusing System; using System.Collections.Generic; using .pdfForm1.csusing System; using System.Collections.Generic; using .pdf
Form1.csusing System; using System.Collections.Generic; using .pdf
apleather
 
Influenza A The recently raised awareness of th.pdf
                     Influenza A  The recently raised awareness of th.pdf                     Influenza A  The recently raised awareness of th.pdf
Influenza A The recently raised awareness of th.pdf
apleather
 
Data warehousing has quickly evolved into a unique and popular busin.pdf
Data warehousing has quickly evolved into a unique and popular busin.pdfData warehousing has quickly evolved into a unique and popular busin.pdf
Data warehousing has quickly evolved into a unique and popular busin.pdf
apleather
 
a) What is the role of Trizol in RNA extractionTrizol reagent is .pdf
a) What is the role of Trizol in RNA extractionTrizol reagent is .pdfa) What is the role of Trizol in RNA extractionTrizol reagent is .pdf
a) What is the role of Trizol in RNA extractionTrizol reagent is .pdf
apleather
 
A) odd numbers caseSequential or linear search is a searching mec.pdf
A) odd numbers caseSequential or linear search is a searching mec.pdfA) odd numbers caseSequential or linear search is a searching mec.pdf
A) odd numbers caseSequential or linear search is a searching mec.pdf
apleather
 
#include stdio.h#include stdlib.h#include string.h#inclu.pdf
#include stdio.h#include stdlib.h#include string.h#inclu.pdf#include stdio.h#include stdlib.h#include string.h#inclu.pdf
#include stdio.h#include stdlib.h#include string.h#inclu.pdf
apleather
 
#include ctype.h #include stdio.h #include string.hstati.pdf
#include ctype.h #include stdio.h #include string.hstati.pdf#include ctype.h #include stdio.h #include string.hstati.pdf
#include ctype.h #include stdio.h #include string.hstati.pdf
apleather
 

More from apleather (20)

Long term capital = Common stock + shareholders equity + Retained ea.pdf
Long term capital = Common stock + shareholders equity + Retained ea.pdfLong term capital = Common stock + shareholders equity + Retained ea.pdf
Long term capital = Common stock + shareholders equity + Retained ea.pdf
 
Limbs evolve so frequently that it is impossible to determine otherw.pdf
Limbs evolve so frequently that it is impossible to determine otherw.pdfLimbs evolve so frequently that it is impossible to determine otherw.pdf
Limbs evolve so frequently that it is impossible to determine otherw.pdf
 
hmmSolutionhmm.pdf
hmmSolutionhmm.pdfhmmSolutionhmm.pdf
hmmSolutionhmm.pdf
 
Form1.csusing System; using System.Collections.Generic; using .pdf
Form1.csusing System; using System.Collections.Generic; using .pdfForm1.csusing System; using System.Collections.Generic; using .pdf
Form1.csusing System; using System.Collections.Generic; using .pdf
 
Influenza A The recently raised awareness of th.pdf
                     Influenza A  The recently raised awareness of th.pdf                     Influenza A  The recently raised awareness of th.pdf
Influenza A The recently raised awareness of th.pdf
 
I believe its named Methyl iodide. You wouldn.pdf
                     I believe its named Methyl iodide. You wouldn.pdf                     I believe its named Methyl iodide. You wouldn.pdf
I believe its named Methyl iodide. You wouldn.pdf
 
Data warehousing has quickly evolved into a unique and popular busin.pdf
Data warehousing has quickly evolved into a unique and popular busin.pdfData warehousing has quickly evolved into a unique and popular busin.pdf
Data warehousing has quickly evolved into a unique and popular busin.pdf
 
balready postedSolutionbalready posted.pdf
balready postedSolutionbalready posted.pdfbalready postedSolutionbalready posted.pdf
balready postedSolutionbalready posted.pdf
 
Assume the graph is strongly connected.SolutionAssume the grap.pdf
Assume the graph is strongly connected.SolutionAssume the grap.pdfAssume the graph is strongly connected.SolutionAssume the grap.pdf
Assume the graph is strongly connected.SolutionAssume the grap.pdf
 
Half life is the time in which the compound reduc.pdf
                     Half life is the time in which the compound reduc.pdf                     Half life is the time in which the compound reduc.pdf
Half life is the time in which the compound reduc.pdf
 
from the given reaction, order NO3=1 overall orde.pdf
                     from the given reaction, order NO3=1 overall orde.pdf                     from the given reaction, order NO3=1 overall orde.pdf
from the given reaction, order NO3=1 overall orde.pdf
 
a) What is the role of Trizol in RNA extractionTrizol reagent is .pdf
a) What is the role of Trizol in RNA extractionTrizol reagent is .pdfa) What is the role of Trizol in RNA extractionTrizol reagent is .pdf
a) What is the role of Trizol in RNA extractionTrizol reagent is .pdf
 
A) odd numbers caseSequential or linear search is a searching mec.pdf
A) odd numbers caseSequential or linear search is a searching mec.pdfA) odd numbers caseSequential or linear search is a searching mec.pdf
A) odd numbers caseSequential or linear search is a searching mec.pdf
 
#include stdio.h#include stdlib.h#include string.h#inclu.pdf
#include stdio.h#include stdlib.h#include string.h#inclu.pdf#include stdio.h#include stdlib.h#include string.h#inclu.pdf
#include stdio.h#include stdlib.h#include string.h#inclu.pdf
 
#include ctype.h #include stdio.h #include string.hstati.pdf
#include ctype.h #include stdio.h #include string.hstati.pdf#include ctype.h #include stdio.h #include string.hstati.pdf
#include ctype.h #include stdio.h #include string.hstati.pdf
 
10. False.Asexually produced organisms are similar as well as iden.pdf
10. False.Asexually produced organisms are similar as well as iden.pdf10. False.Asexually produced organisms are similar as well as iden.pdf
10. False.Asexually produced organisms are similar as well as iden.pdf
 
1) is associated with basic survival instincts of nutrition, memory .pdf
1) is associated with basic survival instincts of nutrition, memory .pdf1) is associated with basic survival instincts of nutrition, memory .pdf
1) is associated with basic survival instincts of nutrition, memory .pdf
 
The image is quite fuzzy. I cant really read. S.pdf
                     The image is quite fuzzy. I cant really read. S.pdf                     The image is quite fuzzy. I cant really read. S.pdf
The image is quite fuzzy. I cant really read. S.pdf
 
Benzaldehyde oxidizes in air to produce benzoic a.pdf
                     Benzaldehyde oxidizes in air to produce benzoic a.pdf                     Benzaldehyde oxidizes in air to produce benzoic a.pdf
Benzaldehyde oxidizes in air to produce benzoic a.pdf
 
B. a condensed structural formula Solution .pdf
                     B. a condensed structural formula  Solution  .pdf                     B. a condensed structural formula  Solution  .pdf
B. a condensed structural formula Solution .pdf
 

Recently uploaded

SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
CaitlinCummins3
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
Peter Brusilovsky
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
中 央社
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
EADTU
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
AnaAcapella
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
EADTU
 

Recently uploaded (20)

8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...
 
UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024UChicago CMSC 23320 - The Best Commit Messages of 2024
UChicago CMSC 23320 - The Best Commit Messages of 2024
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....
 
Observing-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptxObserving-Correct-Grammar-in-Making-Definitions.pptx
Observing-Correct-Grammar-in-Making-Definitions.pptx
 
Improved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio AppImproved Approval Flow in Odoo 17 Studio App
Improved Approval Flow in Odoo 17 Studio App
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"
 
SPLICE Working Group: Reusable Code Examples
SPLICE Working Group:Reusable Code ExamplesSPLICE Working Group:Reusable Code Examples
SPLICE Working Group: Reusable Code Examples
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17
 
male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................
 
e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopal
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
 

SolutionInorder traversal It will consider left child root, and .pdf

  • 1. Solution : Inorder traversal: It will consider left child root, and right child. Inorder Sequence: DHBEIAJFCGK Explanation: Root node is A. left child of A is B. It has children. So move B into stack. stack |B| Travel to the left child of B.It is D. D has children. So move D into stack. stack |D|B| Travel to the left child of D. There is no left child for D. So traverse Back. pop the stack and print. Sequence: D stack |B| move to the right child of D. It is H. it is a leaf. So print it. Sequence: DH So traverse Back. pop the stack and print. Sequence: DHB stack empty similarly process entire tree.