You are on page 1of 2

Engineering College Jhalawar

Department of CSE and IT


Data Structures and Algorithms (3CS4-05)
Mid Term - I, Date: Nov 03, 2020

Timing: 1:00 to 2:30 PM Autumn 2020-21, III Semester Max mark: 50

Attempt all five questions

1. (a) What is data structures? Explain various possible operations which can be
performed on data structures. (4)
(b) Differentiate between stack and queue. (3)
(c) Explain the uses of stack and queue in programming. (3)

2. (a) Compute the postfix equivalent of the following expression:-


c
9
+ 5 ∗ log(n + 1) (3)
(b) Why this permutation(R,S,T,P,Q) can not be obtained in the output (in the
same order) using a stack. Assume that the input sequence is P,Q,R,S,T. (3)
(c) How many stacks are required to implement a Queue. (2)
(d) Which data structure is best to use in programming stack or queue? (2)

3. (a) Why we reduce the number of invocations in Towers of Hanoi? (2)


(b) Write the formula for number of invocation and movement in Towers of Hanoi. (2)
(c) Write the drawbacks of stack and queue. (4)
(d) What data structure is used for browsing and how it is used? (2)

4. (a) Explain the time complexity with suitable example. (2)


(b) List down the all non primitive data structures. (2)
(c) Write the code for push and pop operation in stack. (4)
(d) What is the terminating condition for circular queue? (2)
5. (a) Solve Using round robin algorithm:-

Table 1: Process table for Q. 4 (a)


Process Id Arrival time Burst time
P1 0 5
P2 1 3
P3 2 1
P4 3 2
P5 4 3

If time quantum = 2 unit, calculate the average waiting time and average turn
around time. (5)
(b) Explain the priority queue and circular queue. (5)

Best wishes

Page 2

You might also like