Tutorial-9 5 Solution

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

School of Computer Science Engineering and Technology

Course- BTech Type- Core


Course Code- CSET202 Course Name-Data Structure using C++
Year- 2024 Semester- Odd
Date- 27/9/2024 Batch- Second year

SET-B
CO-PO Mapping
Tutorial No. Name CO1 CO2 CO3 CO4
11 Tree Traversal, ---  -- 
Insertion and
Deletion, BST

Question 1. Determine the preorder from the given inorder and postorder for the tree
traversal. Also draw the tree. (8 mins)
Inorder: 15, 8,19,16,2,10,25,32

Postorder: 15,19,16,8,32,25,10,2

Solution:

Question 2. Determine the postorder from the given inorder and preorder for the tree traversal.
Also draw the tree. (8 mins)
Inorder: a + b * c / d + e - f

Preorder: - + + a / * b c d e f

Solution:
School of Computer Science Engineering and Technology

Question 3. The fig given below shows the schematic diagram of a priority queue
with 7 elements. Draw the structure of the given priority queue in memory using
linear arrays INFO, PRN and LINK. (8 mins)

Solution:

Question 4 consider the following deque of characters where DEQUE is a circular


array which is allocated six memory cells:
LEFT = 2, RIGHT = 4, DEQUE:_, A, C, D,_,_
Describe the deque while the following operations take place,
a) F is added to the right of the deque
School of Computer Science Engineering and Technology

b) Two letters on the right are added


c) K, L and M are added to the left is deleted
d) One letter on the left is deleted
e) R is added to the left on the queue
f) S is added to the right of the queue
g) T is added to the right of the queue.
Solution:

You might also like