University of Engineering & Management, Kolkata
End Semester Examination, January, 2022
Programme Name: Bachelor of Computer Application Semester: 3rd
Course Name: Data Structures with C
Course Code: BCA302
Full Marks: 100 Time: 3 Hours
GROUP – A (20 marks)
Answer the following questions. Each question is of 2 marks 10 x 2 = 20
1. i) What are the differences between linear and non-linear data structure? 2
ii) What are the various ways of declaring a two-dimensional array? Give 2
examples.
iii) Define singly linked list with neat diagram. 2
iv) Define a queue. 2
v) Define a Deque. 2
vi) Write four applications of stack. 2
vii) What is recursion? 2
viii) Write the postfix Form of the following expression using stack: a * b * c. 2
ix) The adjacency matrix of an undirected graph is symmetric-explain. 2
x) What do you mean by collision? 2
GROUP – B (30 marks)
Answer the following questions. Each question is of 5 marks 6 x 5 = 30
2. Write a recursive C function to find factorial of a number. 5
3. Circular queue is needed to overcome the problem of linear queue – Justify. 5
4. Find the sequence of nodes that will be visited using pre-order traversal
algorithm.
5. A. Write an algorithm to insert a new node i) at the beginning ii) at the end of a
5
single linked list.
OR
B. Write an algorithm to delete a node i) after a given node ii) before a given node
5
of a circular doubly linked list.
6. A. Write the C function for insertion and deletion of an element in a linear queue
5
using Array representation.
Page 1 of 2
6.
OR
B. Write ENQUEUE () C function for circular queue using array. 5
7. A. Write a program in C to implement Bubble sort. 5
OR
B. Write a program in C to implement linear search. 5
GROUP - C (50 Marks)
Answer the following questions. Each question is of 10 marks 5 x 10 = 50
8. i) Write a program that removes all nodes that have duplicate information using
5+5
doubly linked list.
ii) Create a single linked list which stores names of the employees. Then sort these
5
names and re-display the contents of the linked list.
9. i) Write a C program to calculate total number of left child in a binary search tree
5+5
of a given node.
ii) Write a C program to calculate the no of leaf node in a binary search tree. 5
10. A. i) Write a program to read an array of n numbers and then find the smallest
5+5
number: Use the concept of passing an array to a function.
ii) Write a program to interchange the largest and smallest number in an array: Use
5
the concept of passing an array to a function.
OR
B. i) Write a Program to print a linked list in reverse order. 5+5
ii) Write a program to delete a node at a given position of a circular linked list. 5
11. A. i) Delete 2 elements from the queue and insert 70, 80 & 90.
(Show the sequence of steps with necessary diagrams with the value of FRONT 5+5
& REAR).
ii) Write a program to reverse the elements of a queue. 5
OR
B. i) Write a C program to split a queue into two queues such that all the elements in
5+5
odd positions are in one queue and those in even positions are in another queue.
ii) Explain two implementation approaches of Priority Queue with suitable
5
diagrams.
12. A. i) Evaluate the following prefix expression using stack:
10
+, –, 9, 2, 7, *, 8, /, 4, 12
OR
B. i) Given an array of sorted numbers: 7, 13, 16, 32, 52, 71, 79, 84, 96, 101 and 145.
5+5
Search the element 79 using interpolation search technique.
ii) Consider an array of integers given below. Sort the values in the array using
merge sort.
5
37, 21, 46, 27, 31, 67.
******************************
Page 2 of 2