You are on page 1of 2

Sinhgad Institute of Technology, Lonavala

Name of Students: Class (Div):S.E. (IT) Roll No.


Subject: DSF Date:

Assignment NO.1 [Unit 01 : STACKS & QUEUES ]

Q.1) Convert the following expression from infix to postfix and prefix. Mention the stack
contents at every step. 2*3/(2-1)+5*3 (DEC 2018,MAY2019-6 Marks)
Q.2) If the values of A, B, C and D are 2, 3, 4 & 5 resp. Calculate the value of following
postfix expressions using stack. (i) AB*C-D+ (ii) ABC+*D- (MAY 2019-6 Marks)
Q.3) State any three stack applications and write a C++ program to evaluate prefix
expression. (MAY 2011-6 Marks)
Q.4) Write a C++ program to convert infix to postfix expression. (MAY 2018-6 Marks)
Q.5) Write a C++ program to represent queue as linked organization. (MAY 2014-6 Marks)
Q.6) Consider circular queue of size 5 as - - A C -. Show the queue contents as
a. F is added to queue
b. Two letters are deleted
c. K, L, M are added.
d. One letter is deleted
e. R is added .
f. S is added. (MAY 2014-6 Marks)
Sinhgad Institute of Technology, Lonavala
Name of Students: Class (Div):S.E. (IT) Roll No.
Subject: DSF Date:

Assignment NO.2 [Unit 02 : TRESS ]

Q.1) Construct a tree from its inorder: 2, 7, 5, 6, 11, 2, 5, 4, 9 and preorder: 2, 7, 2, 6, 5,


11, 5, 9, 4. Also find its postorder. (DEC 2018,MAY2019-6 Marks)
Q.2) Draw BST for the values 45, 7, 21, 76, 1, 54, 22, 4,86. And write recursive algorithm to
find (i) height of tree & (ii) To search data from tree. (MAY 2017-6 Marks)
Q.3) Construct expression tree for postorder: abc-+de-fg+h-/* inorder: a+b-c*d-e/f+g-h. Find
its preorder. (MAY 2018-6 Marks)
Q.4) Construct binary tree from preorder: A, B, D, H, I, E, C, G, F, J, K and postorder: H, I,
D, E, B, J, K, F, G, C, A. Also find its inorder. (MAY 2018-6 Marks)
Q.5) Write a C++ program for nonrecursive inorder and preorder tree traversal.
(MAY 2014-6 Marks)

You might also like