You are on page 1of 4

PART A

1. For a binary tree T, the Pre-Order and In-Order traversal sequences are as
Follows:-

Pre-Order: A B L M K N P Q

In-Order: L B M A N K Q P

Draw the Binary Tree.

ANS: AA

B K

P
L M N

QUES 2. For a binary tree T, the Pre-Order and In-Order traversal sequences are as

Follows:-

Pre-Order: A B E H Q R C D K L M

In-Order: B Q R H E A D L K M C

(a) The height of tree is ?

(b) The internal nodes are ?

(c) The post order transversal is?

A
A

B C

E
D

H K

Q
L M

(d) The height of tree is 6

(e) The internal nodes are B ,C ,E ,D ,H ,K ,Q ,L ,M.

(f) The post order transversal is : B ,Q ,R ,H ,E ,D ,L ,M ,K ,C ,A .

QUES 3. Suppose a binary tree is in memory:-

ROOT

14

INFO LEFT RIGHT

1 H 4 11

2 R 0 0

3 17

4 P 0 0

5 B 18 7

6 3

7 E 1 0

8 6
9 C 0 10

10 F 15 16

11 Q 0 12

12 S 0 0

13 0

14 A 5 9

15 K 2 0

16 L 0 0

17 13

18 D 0 0

Draw the Binary Tree.

ANS:

B C

D E
K L
H
R

Q
P

S
PART B

4. Consider the algebraic expression E= (2x + y)(5a – b)3

(a) Draw the tree T which corresponds to the expression E.


(b) Find the Pre-Order of T.

5. Create a Min-heap for following series:

11 9 7 15 14 8 10 13

You might also like