0% found this document useful (0 votes)
1 views

CPDS

Uploaded by

ElakkiyaSruthi
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views

CPDS

Uploaded by

ElakkiyaSruthi
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Reg.

No:

VANDAYAR ENGINEERING COLLEGE


Third Semester
ECE AND EEE
CS3353 – C PROGRAMMIND and DATA STRUCTURES
MODEL EXAMINATION
Time:3:00 Hours Marks: 100
Answer All the Questions

PART –A (10*2 = 20 marks)


1. What is recursive function?
2. When in the ternary operator used?
3. Define Enumerated datatype.

4. What is ADT? Give an example.


5. Data are enqueued to (ENQ operation) and dequeued from (DEQ operation) a queue in the
following order:
ENQ 4; ENQ 9; FRONT; ENQ 7; ENQ 19; FRONT; DEQ; DEQ; FRONT;
Write the values returned by FRONT for the sequence of operation above.
6. What is the preprocessor directives in C?
7. When is rehashing necessary/
8. What is an expression tree?
9. When is linear search is highly inefficient compared to binary search?
10. Give an example of max heap and min heap.
PART –B (13*5 = 65 marks)

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)

Prepared by Verified by HOD Sign


Reg. No:

Prepared by Verified by HOD Sign

You might also like