Construction of a binary tree , Data Structure & Algorithms

Q. Construct a binary tree whose nodes in inorder and preorder are written as follows:

Inorder : 10, 15, 17, 18, 20, 25, 30, 35, 38, 40, 50

Preorder: 20, 15, 10, 18, 17, 30, 25, 40, 35, 38, 50                        

 

Ans:

Construction of a Binary tree whose nodes in inorder and preorder are written as follows:-

Inorder:- 10, 15, 17, 18, 20, 25, 30, 35, 38, 40, 50

 

Preorder:- 20, 15, 10, 18, 17, 30, 25, 40, 35, 38, 50

2477_Preorder.png

Posted Date: 7/10/2012 6:27:39 AM | Location : United States







Related Discussions:- Construction of a binary tree , Assignment Help, Ask Question on Construction of a binary tree , Get Answer, Expert's Help, Construction of a binary tree Discussions

Write discussion on Construction of a binary tree
Your posts are moderated
Related Questions
Advantages of First in First out (FIFO) Costing Advantages claimed for first in first  out (FIFO)  costing method are: 1. Materials used are drawn from the cost record in

How to construct a data flow diagram for a college assignment and marking systemA

The Ruby Programming Language Although data structures and algorithms we study aren't tied to any program or programming language, we need to write particular programs in speci

3. A function to convert a complex number in algebraic form to a complex number in phasor form

advanatges of dynamic data structure in programming

QUESTION (a) Define a tree and list its properties. (b) By showing all your workings, draw the spanning tree for the following graph based on the Breadth-First-Search algori

Q1. Define the following terms: (i) Abstract data type. (ii) Column major ordering for arrays. (iii)  Row major ordering for arrays. Q2. Explain the following: (i) A

Explain in brief about the Container An entity which holds finitely many other entities. Just as containers such as boxes, baskets, bags, pails, cans, drawers, and so for

Insertion & deletion of target key requires splaying of the tree. In case of insertion, the tree is splayed to find the target. If, target key is found out, then we have a duplicat

Define Strictly Binary Tree Strictly Binary Tree: - If each non leaf node in binary tree has non empty left and right sub-trees , then the tree is known as a strictly binary t