22CS201 – Data Structures (Lab Integrated)-1

You might also like

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

Reg. No.

R.M.D. ENGINEERING COLLEGE


(An Autonomous Institution)
RSM Nagar, Kavaraipettai – 601 206

QP CODE: B23212
B.E. / B.TECH - END SEMESTER THEORY EXAMINATIONS – APRIL / MAY 2023
Second Semester
Computer Science Engineering / Electronics and Communication Engineering /
Artificial Intelligence and Machine Learning / Information Technology
22CS201 – Data Structures (Lab Integrated)
(Regulations – 2022)
COs Course Outcome : The students, after the completion of the course, are expected to
CO1 Implement abstract data types for list.
CO2 Solve real world problems using appropriate linear data structures.
CO3 Apply appropriate tree data structures in problem solving.
CO4 Implement appropriate Graph representations and solve real-world applications.
CO5 Implement various searching and sorting algorithms.
Time : 3 Hours Answer ALL Questions Max. Marks : 100
Part-A (10 x 2 = 20 Marks)
1. Define the term Abstract Data Type.
2. State the advantages of doubly linked list over singly linked list.
3. Write down the postfix and prefix forms of the following expression: A+B*(C-D)/(E-F).
4. List the various operations that can be performed on the Queue.
5. Define the Height and Depth of Tree.
6. Recall the steps involved in deleting a node from a binary search tree.
7. When a graph is said to be weakly connected?
8. Give a short description about topological sort.
9. What is the output of selection sort after the 2nd iteration, given the following sequence?
17 3 45 8 27 13
10. Define Hash Function.
Part – B ( 5 x 13 = 65 Marks)
11.a. Write and explain with suitable diagrams, the algorithm for insertion operations that can be
performed in a doubly linked list. (13)
Or
11.b. How polynomial expression can be represented using linked list? Write and explain an
algorithm to add two polynomial expressions. (13)

12.a. (i) Write an ADT to implement stack of size N using an array. The elements in the stack are to
be integers. The operations to be supported are PUSH, POP and DISPLAY. Take into account
the exceptions of stack overflow and stack underflow. (6)
(ii) A circular queue has a size of 5 and has 3 elements 20, 60 and 80 where F=2 and R=4.
After inserting 100 and 120, what is the value of F and R. What will happen when we try to
insert 40 at this stage? Delete 2 elements from the queue and insert 140, 160 & 200. Show the
sequence of steps with necessary diagrams with the value of F & R.
(7)
Or
12.b. (i) Enumerate the steps involved in converting the following infix expression to postfix
expression. (A * B) + (C / D). (6)
(ii) Write the steps to be followed and tabulate the stack contents and sequence of algorithmic
steps required to evaluate the postfix expression by substituting the values A = 8, B = 2, C = 3,
D= 4 in A B C + * D /. (7)

13.a. Construct an expression tree for the following expression (a+b*c) + ((d*e+f)*g). Give the
results when inorder, preorder and postorder traversals are applied onto the expression. (13)
Or
13.b. Write the algorithms that are used to perform single and double rotation on AVL tree. (13)

14.a. Discuss in detail about breadth first algorithm with suitable example. (13)
Or
14.b. Write an algorithm and explain how to determine the bi-connected components in a graph.(13)

15.a. Design a function to implement the Insertion Sort Algorithm. With the algorithm, sort the
given numbers.10, 51, 2, 18, 4, 31, 13, 5, 23, 64, 29. (13)
Or
15.b. Explain the following:
(i) Re-hashing (6)
(ii) Extendible Hashing (7)

Part – C ( 1 x 15 = 15 Marks)

16.a. Develop and explain the working procedure of a C++ program to check whether the given
arithmetic expression [{(x+y) – (a+b)} * z] contains balanced parenthesis or not. (15)
Or
16.b. Develop and explain the working procedure of a C++ program to create two singly linked lists
that can store integer numbers and print the union and intersection of the created linked lists.
(15)


You might also like