Computer Science (Semester 3)
Total marks: 80
Total time: 3 Hours
INSTRUCTIONS
(1) Question 1 is compulsory.
(2) Attempt any three from the remaining questions.
(3) Draw neat diagrams wherever necessary.
PART - A
1.a.
What are the disadvantages of an array?
(2 marks)
00
1.b.
Explain how to find the performance of an algorithm.
(3 marks)
00
1.c.
What are the disadvantages of queue which is implemented using array and how to overcome it?
(2 marks)
00
1.d.
Differentiate between doubly and circular linked lists.
(3 marks)
00
1.e.
Explain how binary tree is represented using an array and linked list
(2 marks)
00
1.f.
Explain the threaded binary tree with suitable example
(3 marks)
00
1.g.
Define Hash Clashing.
(2 marks)
00
1.h.
Compare Selection sort and Quick sort with an example.
(3 marks)
00
1.i.
Write an algorithm to insert an element into the binary search tree.
(2 marks)
00
1.j.
Explain the properties of Red-Black tree:
(3 marks)
00
PART - B
2.a.
Write a program to concatenate singly linked lists.
(5 marks)
00
2.b.
How two dimensional arrays are represented in memory? Also obtain the formula for calculating the address of any element stored in the array, in case of column major order.
(5 marks)
00
OR
3.a.
Write a program to implement a sparse matrix.
(5 marks)
00
3.b.
How can we represent a polynomial in a linked list?
(5 marks)
00
4.a.
Explain the Towers of Hanoi problem with an example.
(5 marks)
00
4.b.
Write a program to implement the operations of Queue.
(5 marks)
00
OR
5.a.
Write a recursive procedure to compute the $\mathrm{n}^{\text { th }}$ Fibonacci number.
(5 marks)
00
5.b.
What are the applications of queue?
(5 marks)
00
6.a.
Write an algorithm to find the components of a graph.
(5 marks)
00
6.b.
Define Priority Queue? Explain with an example.
(5 marks)
00
OR
7.a.
Differentiate between BFS and DFS.
(5 marks)
00
7.b.
Define Binary tree. Explain the Binary tree representations with an example.
(5 marks)
00
8.a.
Write an algorithm of Linear Search.
(5 marks)
00
8.b.
Sort the following list of elements by using İnsertion Sort".
$15,28,46,10,35,54,5,17$
(5 marks)
00
OR
9.a.
Insert the following list of elements into the hash table by using Linear Probing (size of the hash table is 10$)$
36,48, 66, 27,23,87,10, 12
\lt/div\gt
\ltspan class='paper-ques-marks'\gt(5 marks)\lt/span\gt
\ltspan class='paper-page-id'\gt00\lt/span\gt
\lt/div\gt
\ltDIV class='paper-question'\gt
\ltDIV class='paper-ques-desc'\gt
\ltb\gt9.b.\lt/b\gt
Explain the Radix sort with an example."
\lt/div\gt
\ltspan class='paper-ques-marks'\gt(5 marks)\lt/span\gt
\ltspan class='paper-page-id'\gt00\lt/span\gt
\lt/div\gt
\ltDIV class='paper-question'\gt
\ltDIV class='paper-ques-desc'\gt
\ltb\gt10.a.\lt/b\gt
Construct the AVL tree of the following data
$20,40,25,18,15,5,10,46,60$
(5 marks)
00
10.b.
Draw the flow chart of splaying operations of splay tree.
(5 marks)
00
OR
11.a.
Consider the string = "GCATCGCAGAGAGTATACAGTACG" and search strinig is "AGTATACA" by using the KMP algorithm
(5 marks)
00
11.b.
What is trie? Explain the compressed trie with an example.
(5 marks)
00