CPDS
CPDS
No:
11. a) What is the use of looping? Explain about the entry- controlled and exit- controlled loops
available in ‘C’ with appropriate sample C programs.
OR
b) What is an array? List the various types of arrays. Elaborate on t- D array with an
example.
12. a) (i) Differentiate between Structure and Union.
(5)
(ii) Explain the various text file opening modes and their meaning in “C”.
(4)
(iii) With an example, show how to define a structure, create a structure variables and
initialise it. (4)
OR
b) (i) Write a “C” program to find the sum of diagonal elements of the given matrix. (5)
Prepared by Verified by HOD Sign
Reg. No:
(ii) Define Macro. Write a Macro to find the area of rectangle and use it in a C program. (4)
(iii) Write a “C” program to find the largest element in an array using Pointers.
(4)
13. a) (i) Write and explain the algorithms of enqueue and dequeue operations of queue. (7)
(ii) Write short notes on doubly linked list with few operations. (6)
OR
b) (i) Write and explain the algorithms of peek and display operations of stack. (7)
(ii) With appropriate diagram explain any one application of queue. (6)
14. a) (i) Distinguish between binary tree and expression tree with example. (5)
(ii) What is open addressing? Explain the collision resolution strategies in open addressing
with examples. (8)
OR
b) State and explain the insertion and deletion operation in a binary search tree with example.
15. a) Explain the basic idea behind insertion sort and how it works. Illustrate with pseudo code
and a suitable example.
OR
b) Distinguish between min heap and max heap. Show how heap sort process the input 142,
543, 123, 65, 453, 879, 572, 434, 111, 242, 311 and 102.
PART –C (1*15 = 15 marks)
16. a) Given input {4371, 1323, 6173, 4199, 4344, 9679, 1989} and a hash function h(x)
=X(mod 10), show the resulting
(i) Separate chaining hash table (3)
(ii) Open addressing hash table using linear probing (4)
(iii) Open addressing hash table using quadratic probing (4)
(iv) Open addressing hash table with second hash function h2(x) = 7-(x mod 7) (4)
OR
b) Sort the sequence 4, 6, 8, 2, 9, 5, 1, 7 and 3 using the following
(i) Merge sort (8)
(ii) Quick sort (Picking the first element as the pivot). (7)