BT-3/D-22 43139
DATA STRUCTURES AND ALGORITHMS
PC-CS-201A
Time: Three Hours] [Maximum Marks :75
Note : Attempt Five questions in all, selecting at least one
question from cach Unit. All questions carry equal
marks.
Unit I
I 1/Differentiate between different Dynamic memory allocation
methods used in C. Explain thè problems assocjated with
these methods and how to overcome those problems.
Also, implement a C program to store and display record
of an Employee dynamically and the record contains
Name, age and ID. 15
2. Answer the following questions related with sorting and
searching:
(a) Write down the pseudo code of Insertion and
computer the time complexity of insertion sort in
all the three cases i.e. worst case, average casce and
best case. 8
(5-3213) 43139 P.T.O.
(6) Explain step by step how to perforn searching with B (a) What is the difference between singly linked list
Binary scarch if given data is : and doubly linked list ? Also discuss pros and cons
15, 23, 45, 66, 78, 99, 125, 150, 266, 280 and of these. 8
searched iten in the given array is 150. 7 (b) Write an algorithm to construct a simple linked list
Unit II with 5nodes and print the content of linked list
B. Consider the following aithmetic expression X, written starting from the given node. 7
in Infix notation. Translate X, into its equivalent Postfix Unit IV
expression with the help of Infix to Postfix expression 7. What is Balanced Multiway Search Tree ? Explain its
algorithm : construction and applications. Consider a graph with five
X:K + L- M*N + (0 A P) * WIUV*T + Q vertices and six edges, then explain how to find out
Minimum Spanning Tree (MST). Also explain Warshal's
Also, discuss the advantages of Postfix and Prefix
algorithm. 15
expressions over Infix expression. 15
8. What is AVL tree ? Explain its need. With input data
A. Discuss the difference bctween simple queue and circular
125, 112, 117, 130, 15, 69, 11s, 114, 137, 127, 140, 129,
queue. Also, consider any array and write the pseudo 128 depict step by step construction of an AVL Tree.
code for how elements are enqucucd and dequeued from Also, delete 140, 129, 128 from the AVL tree and draw
the circular queue along with their overflow and underflow the final one after deletion. 15
conditions. 15
Unit III
5. What is linked list ? Why do you add header node in the
linked list ? Also define circular linked list and write a
function of how to add an element at the specified position
and at the end of the circular linked list. 15
LAS139
(5-3214) L-43139 3
1,200
23C Haze