Skip to content
SmartFigureEdu

CS 3353 C Programming and Data Structures question paper, November/December 2023

Question Paper Code : 20866

B.E./B.Tech. DEGREE EXAMINATIONS, NOVEMBER/DECEMBER 2023.

Third Semester

Electrical and Electronics Engineering

CS 3353 — C PROGRAMMING AND DATA STRUCTURES

(Common to : Electronics and Communication Engineering/Electronics and Instrumentation Engineering/Electronics and Telecommunication Engineering/Instrumentation and Control Engineering)

(Regulations 2021)

Time : Three hoursMaximum : 100 marks

Answer ALL questions.

PART A — (10 × 2 = 20 marks)

  1. 1.

    What are the types of conditional statements in C.

  2. 2.

    What is the output of the program? #include < stdio.h> #define m 5 + 5 const int n = 5 + 5; void main() { int a = 0, b = 0; a = m * m; b = n * n; printf("%d %d\n", a,b); }

  3. 3.

    What is the preprocessor directives in C?

  4. 4.

    What will be the value of j for below-mentioned values of i? switch (i) { case 2:i = i * i; case 4:i = i * i; default : i = i * i; break; case 16 : i = i * i; } j = i; for I = 2, j = ? for I = 16, j = ?

  5. 5.

    What is ADT? Give example.

  6. 6.

    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 operations above.

  7. 7.

    Define separate chaining?

  8. 8.

    What is the preorder and post order traversal of the figure 1? [Figure 1: binary tree with root 6; 6 has children 4 and 12; 4 has children 1 and 5; 12 has children 10 and 30; 10 has right child 11]

  9. 9.

    When is linear search is highly inefficient compared to binary search?

  10. 10.

    Give an example on max heap and min heap.

PART B — (5 × 13 = 65 marks)

  1. 11.
    (a)
    • (i)State and explain the single and multi-dimensional array with examples.(5)
    • (ii)Write C program for a double dimensional array: (3+3+2) (1) Find largest and smallest value. (2) Find sum of non-diagonal elements. (3) Find the transpose of a matrix.(8)
  2. Or
  3. (b)
    • (i)Distinguish between interative and recursive function with suitable example.(5)
    • (ii)Write both iterative and recursive functions in C to evaluable a^b. (4+4)(8)
  4. 12.
    (a)
    • (i)Distinguish between structures and unions with example.(5)
    • (ii)State the need of pointers in C program? Explain the usage of integer pointer and structure pointer with example.(8)
  5. Or
  6. (b)
    • (i)State and explain the preprocessor directives.(5)
    • (ii)What are different types of files available. Write a C program to copy the content of one file to another.(8)
  7. 13.
    (a)
    • (i)What is doubly linked list. Write the function to insert and remove elements from a doubly linked list.(5)
    • (ii)How to implement the stack ADT using two queues? Write the function for the push and pop operations (Note : Simulate stack operations using two queues).(8)
  8. Or
  9. (b)
    • (i)Write the function for adding and removal of an element from a queue using array implementation.(5)
    • (ii)Convert the following Infix expression into postfix expression x * (w + y / 2 * x ^ (4 + x) and evaluate the obtained postfix expression using the values (x = 1, y = 2, w = 3).(8)
  10. 14.
    (a)
    • (i)Distinguish between binary tree and expression tree with examples.(5)
    • (ii)What is open addressing? Explain the collision resolution strategies in open addressing with examples.(8)
  11. Or
  12. (b)

    State and explain the insertion and deletion operation in a binary search free with example.

  13. 15.
    (a)
    • (i)State and explain quick sort. Perform it with the following combinations. Pivot : First element, Last element.(8)
    • (ii)Sort the sequence 3,1,4,1,5,9,2,6,5 using insertion sort. Show the content of the array after every iteration of the sort.(5)
  14. Or
  15. (b)
    • (i)Distinguish between linear and binary search with example.(6)
    • (ii)Show the heap sort process to the following input sequence 142, 543, 123, 65, 453, 879, 572, 434, 111, 242, 811, 102(7)

PART C — (1 × 15 = 15 marks)

  1. 16.
    (a)

    Create nested structures to store name, id, pay, and deductions for the set of 100 employees in an organization. Given pay and deductions are monthly details, same for all the months. The deductions include GPF, FBF and SPF. Write a C program to calculate income tax to be paid if total income exceeds 1 lakh with tax as 20% of the excess amount and 30% if total exceeds 3 lakhs. Print the report with name, id, and tax to be paid.

  2. Or
  3. (b)

    Suppose we know the preorder and postorder traversal sequences of a binary tree T.

    • (i)Can we uniquely determine the binary tree? Justify.
    • (ii)Suppose we know that all the non-leaf nodes of T have two children. Explain, using an algorithm, on how we can recover T from the two sequences.
    • (iii)Let the preorder traversal sequence of T be 100, 34, 16, 9, 8, 38, 11, 4, 81 and postorder traversal sequence be 34, 9, 11, 4, 38, 81, 8, 16, 100. If all the non-leaf nodes of T have two children, identify T.

    (3+6+6)


Other CS3353 papers