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

Department of Computer Science & Engineering, NIT Hamirpur (HP)

Mid Semester Examination, March 2021 (B.Tech. III Sem (CSE Roll No. 20BCS076 -
20BCS124 & DD))
Subject: Data Structures Time: 90 Mts
Code: CS-201 Max Marks: 30
…………………………………………………………………………………………………………………………………………………………….

Note: Attempt all the questions.


Q1. Convert the Infix expression A+B/C*(D-F)^F*G/H in Postfix using a suitable data
structure. Show each of the intermediate steps. [4]
Q2. Evaluate the prefix expression + / ^ 8 2 * 4 5 ^ * 8 / 3 6 2 using a suitable data structure.
Show each of the intermediate steps. [4]
Q3. Let there exist a singly linked list to store integers at its nodes. Write a C/C++ function to
compute the sum of prime numbers stored at different nodes of the linked list [5]
Q4. Compute the value of Ackerman function F(3,3) [6]
Q5. Calculate the count of swap and comparison operations performed to sort the following
list of elements using Insertion Sort algorithm [5]
15, 5, 8, 20, 25, 6, 8, 12, 4, 2, 35
Q6. Write a function to swap the data of first node to the last node, second node to the second
last node and so on in a doubly linked list. [6]

You might also like