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.
Module 1
1.a.
Define data structures. Give its classifications.
(6 marks)
00
1.b.
Define structures with example
(4 marks)
00
1.c.
Define pointers. Give advantages and disadvantages of pointers.
(6 marks)
00
Or
2.a.
Write a program (i) reverse a string (ii) concatenatc two strings
(8 marks)
00
2.b.
Explain dynamic memory allocation in detail
(8 marks)
00
Module - 2
3.a.
Define stack. Implement push and pop function for stack using arrays.
(8 marks)
00
3.b.
Write the postfix form of the following expressions:
(i) ((6 + (3 - 2) *4) ↑ 5 + 7)
(i) A $ H $ C * D
(8 marks)
00
Or
4.a.
Define queues. Implement Qinsert and Qdelete function for queues using arrays.
(8 marks)
00
4.b.
Define recursion. Write recursive program for (i) factorial of a number, (i) tower of Hanoi
(8 marks)
00
Module - 3
5.a.
Write the following function for singly linked list: (i) reverse the list (ii)Concatenate two lists.
(8 marks)
00
5.b.
Write functions insert front and delete_front using doubly linked list
(8 marks)
00
Or
6.a.
Write an algorithm to add two polynomials.
(8 marks)
00
6.b.
Define sparse matrix. Give sparse Matrix representation of linked list for given matrix.

(5 marks)
00
Module 4
7.a.
What is a tree? Explain:
i) binary tree
ii) strictly binary tree
iii) complete binary tree
iv) Skewed binary tree
(8 marks)
00
7.b.
Given inorder sequence: DJGBHEAFKIC and postorder sequence : JGDHEBKIFCA.
Construct binary tree and give preorder traversal
(8 marks)
00
Or
8.a.
Explain threaded binary tree in detail .
(8 marks)
00
8.b.
write a function to insert an item into an ordered binary search tree (duplicate items are not allowed)
(8 marks)
00
Module-5
9.a.
Define graph. give agency Matrix and adjacency linked list for the given weighted graph in Fig.Q9(a)

(8 marks)
00
9.b.
Write an algorithm for breadth first search and depth first search.
(8 marks)
00
Or
10.a.
Write an algorithm for radix sort.
(8 marks)
00
10.b
Explain hashing in detail
(8 marks)
00