Skip to content
SmartFigureEduExam kits ₹19

CS3353 · 7 papers compared

CS 3353 C Programming and Data Structures important questions

CS3353 exam kitModel answers + all papers, 1 PDF

Exam kit

Needed by the payment gateway. Not shared or used for marketing.

Secure payment by Cashfree Payments (UPI, cards, net banking). One-time payment, no subscription. The payment page may show StrangerYaar, the business that processes payments for SmartFigure.Terms · Refunds

ANNA UNIVERSITY · REGULATION 2021

Important Questions

CS 3353 — C PROGRAMMING AND DATA STRUCTURES

Third Semester · Electrical and Electronics Engineering

Prepared from 7 previous year question papers (Apr/May 2026, Apr/May 2025, Nov/Dec 2024, Apr/May 2024, Nov/Dec 2023, Apr/May 2023, Nov/Dec 2022). Every question was compared with the others of its unit; the ones asked more than once come first. "Most asked topics" shows in how many different exams a syllabus topic had a question.

UNIT 1C Programming Fundamentals

Most asked topics: Arrays (5/7) · Functions (4/7) · Recursive Functions (4/7) · Data Types (3/7) · Conditional Statements (2/7) · Expressions and Statements (1/7)

Part A · 2 marks

  1. 1.
    What do you mean by C token?

    Asked in Apr/May 2026

    (2)
  2. 2.
    Differentiate between exit controlled and entry controlled loops.

    Asked in Apr/May 2026

    (2)
  3. 3.
    Define Data Types.

    Asked in Apr/May 2025

    (2)
  4. 4.
    Write a Program to find whether the given number is odd or even.

    Asked in Apr/May 2025

    (2)
  5. 5.
    Mention any four primary Data types of C language.

    Asked in Nov/Dec 2024

    (2)
  6. 6.
    Find the error in the expression. int k=0.5;

    Asked in Nov/Dec 2024

    (2)

Part B · 13 marks

  1. 1.
    (i) Why we use functions in C languages. Give example. (ii) Write both iterative and recursive functions in C to evaluable a^b.

    Asked 2 times: Apr/May 2024, Nov/Dec 2023

    Free sample · model answer from the exam kit

    (i) Why we use functions in C

    A function is a self-contained block of statements that performs a specific task and can be called whenever that task is needed. Every C program has at least one function, main().

    Reasons for using functions:

    • Modularity: a large program is divided into small, manageable modules, each doing one job.
    • Reusability: a function is written once and called many times, from the same or other programs.
    • Avoids repetition: the same code need not be typed again, so the program becomes shorter.
    • Easy debugging and testing: errors can be located and corrected function by function.
    • Readability: main() becomes a short summary of the whole program.
    • Team work: different programmers can write different functions.

    A function has three parts:

    1. Function declaration (prototype): int add(int, int);
    2. Function call: s = add(a, b);
    3. Function definition: the actual body.

    Example:

    #include <stdio.h>
    
    int add(int x, int y);          /* declaration */
    
    int main(void)
    {
        int s = add(10, 20);        /* call: actual arguments 10, 20 */
        printf("Sum = %d\n", s);    /* Sum = 30 */
        return 0;
    }
    
    int add(int x, int y)           /* definition: formal parameters */
    {
        return x + y;
    }

    Draw: Control flow for a function call: box main() with statement s = add(10, 20); arrow labelled "x = 10, y = 20" to box add(); inside add() "return x + y"; return arrow labelled "30" back to main().

    Types of functions: library functions (printf, sqrt, strlen) and user-defined functions (add). Based on arguments and return value: no argument no return, argument without return, no argument with return, and argument with return.

    (ii) Iterative and recursive functions for a^b

    Iterative idea: start with result = 1 and multiply by a, b times.

    Recursive idea: a^b = a × a^(b−1) with the base case a^0 = 1.

    #include <stdio.h>
    
    /* iterative: multiply a, b times */
    long powerIter(int a, int b)
    {
        long result = 1;
        int i;
        for (i = 1; i <= b; i++)
            result = result * a;
        return result;
    }
    
    /* recursive: a^b = a * a^(b-1), a^0 = 1 */
    long powerRec(int a, int b)
    {
        if (b == 0)
            return 1;                    /* base case */
        return a * powerRec(a, b - 1);   /* recursive case */
    }
    
    int main(void)
    {
        int a, b;
        printf("Enter base and exponent: ");
        scanf("%d %d", &a, &b);
        printf("Iterative: %d^%d = %ld\n", a, b, powerIter(a, b));
        printf("Recursive: %d^%d = %ld\n", a, b, powerRec(a, b));
        return 0;
    }

    Trace of the recursive function for a = 2, b = 5:

    1. powerRec(2,5) = 2 × powerRec(2,4)
    2. powerRec(2,4) = 2 × powerRec(2,3)
    3. powerRec(2,3) = 2 × powerRec(2,2)
    4. powerRec(2,2) = 2 × powerRec(2,1)
    5. powerRec(2,1) = 2 × powerRec(2,0)
    6. powerRec(2,0) = 1 (base case), so the results return as 2, 4, 8, 16, 32.

    Output:

    Enter base and exponent: 2 5
    Iterative: 2^5 = 32
    Recursive: 2^5 = 32

    Both versions do b multiplications, so time is O(b). The iterative version uses O(1) memory; the recursive version uses O(b) stack space for the pending calls.

    The CS3353 exam kit has model answers like this for 32 of these questions.

    (13)
  2. 2.
    (i) Explain data types, operators, and conditional statements in C with syntax and suitable examples. (ii) Write a C program to find the GCD of two numbers using recursion.

    Asked in Apr/May 2026

    (13)
  3. 3.
    (i) Write short notes on arrays and explain how 1D and 2D arrays are declared and initialized with examples. (ii) Write a C program to perform matrix multiplication

    Asked in Apr/May 2026

    (13)
  4. 4.
    (i) Write a program to find whether the entered character is a vowel or note. (ii) Develop a program to print the position of the smallest number of "n" numbers using arrays. (iii) Differentiate between while and do-while loops.

    Asked in Apr/May 2025

    (13)

UNIT 2C Programming - Advanced Features

Most asked topics: Union (6/7) · Structures (5/7) · Preprocessor Directives (3/7) · Arrays and Functions (2/7)

Part A · 2 marks

  1. 1.
    What are preprocessor directives?

    Asked 2 times: Apr/May 2024, Nov/Dec 2023

    (2)
  2. 2.
    What is an enumerated data type in C? Give an example.

    Asked in Apr/May 2026

    (2)
  3. 3.
    What is constant pointer? Why array is called constant pointer?

    Asked in Apr/May 2026

    (2)
  4. 4.
    State the purpose of "typedef' in C Programming.

    Asked in Apr/May 2025

    (2)
  5. 5.
    What will be the output of the following C code? #include <stdio.h> union { int x; char y; }p; int main() { p.x = 10; printf("%d\n", sizeof(p)); }

    Asked in Apr/May 2025

    (2)
  6. 6.
    Define the syntax of structures.

    Asked in Nov/Dec 2024

    (2)

Part B · 13 marks

  1. 1.
    Explain the concept of pointers with examples. Discuss pointer arithmetic and pointer to pointer operations.

    Asked in Apr/May 2026

    (13)
  2. 2.
    Write in detail about structures and unions. Explain how arrays of structures are declared and accessed in C.

    Asked in Apr/May 2026

    (13)
  3. 3.
    (i) How a structure can be created by initializing the variables and how it can be accessed. (ii) Write a program to find smallest of three numbers using structures. (iii) Differentiate between structure and array.

    Asked in Apr/May 2025

    (13)
  4. 4.
    (i) Differentiate between a binary file and a text file. (ii) Specify the various attributed that can be used in a file system. (iii) Write a program to add two integers using pointers and functions.

    Asked in Apr/May 2025

    (13)

UNIT 3Linear Data Structures

Most asked topics: Linked List (6/7) · Doubly-Linked Lists (5/7) · Applications (4/7) · Applications (4/7) · Stack ADT (3/7) · List ADT (2/7)

Part A · 2 marks

  1. 1.
    What is ADT? Give an example.

    Asked 2 times: Apr/May 2026, Nov/Dec 2023

    (2)
  2. 2.
    Write a function to insert a node at the beginning of a singly linked list.

    Asked in Apr/May 2026

    (2)
  3. 3.
    Why doubly linked list is more useful than a singly linked list.

    Asked in Apr/May 2025

    (2)
  4. 4.
    Name any two applications of priority queues.

    Asked in Apr/May 2025

    (2)
  5. 5.
    Define linked list.

    Asked in Nov/Dec 2024

    (2)
  6. 6.
    What operation does 'isEmpty( )' function performs?

    Asked in Nov/Dec 2024

    (2)

Part B · 13 marks

  1. 1.
    Explain the implementation of stacks using arrays and linked lists. Illustrate with push and pop operations.

    Asked in Apr/May 2026

    (13)
  2. 2.
    Discuss queue operations (enqueue, dequeue) and differentiate between linear queue and circular queue.

    Asked in Apr/May 2026

    (13)
  3. 3.
    (i) Create a linked list which stores names of the employees. Then sort these names and re-display the contents of the linked list. (ii) Give the linked representation of the following polynomial: 7x^3y^2 - 8x^2y + 3xy + 11x - 4. (iii) Write an algorithm for evaluation of a prefix expression.

    Asked in Apr/May 2025

    (13)
  4. 4.
    (i) Devise an algorithm to insert and delete an element from a linked queue. (ii) Write a function that accepts two stacks. Copy the contents of first stack in the second stack by preserving the order of the elements. (iii) Differentiate between peek() and pop() functions.

    Asked in Apr/May 2025

    (13)

UNIT 4Non-Linear Data Structures

Most asked topics: Tree Traversals (7/7) · Hashing (5/7) · Binary Search Tree (4/7) · Double Hashing (4/7) · Open Addressing (3/7) · Binary Trees (2/7)

Part A · 2 marks

  1. 1.
    When is rehashing necessary?

    Asked 2 times: Apr/May 2024, Apr/May 2023

    (2)
  2. 2.
    Define separate chaining?

    Asked 2 times: Nov/Dec 2023, Nov/Dec 2022

    (2)
  3. 3.
    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]

    Asked 2 times: Nov/Dec 2023, Nov/Dec 2022

    (2)
  4. 4.
    Write a C function to perform in-order traversal of a binary tree.

    Asked in Apr/May 2026

    (2)
  5. 5.
    What is a hash collision? Give an example.

    Asked in Apr/May 2026

    (2)
  6. 6.
    Write short note on Hash Table.

    Asked in Apr/May 2025

    (2)

Part B · 13 marks

  1. 1.
    Explain the binary search tree (BST) and its operations with examples.

    Asked 2 times: Apr/May 2026, Apr/May 2024

    (13)
  2. 2.
    Describe hashing techniques: open addressing, linear probing, and double hashing with suitable examples.

    Asked in Apr/May 2026

    (13)
  3. 3.
    (i) Consider the following binary search tree [Figure: BST with root 100; 100 has children 20 and 200; 20 has children 10 and 30; 200 has children 150 and 300] Find the Preorder, Inorder and Postorder traversal and show the deletion of rootnote. (ii) Explain the steps involved in the multiplication method of hash function. (iii) Calculate the hash value for keys 1234 and 5642 using the mid-square method. The hash table has 100 memory locations.

    Asked in Apr/May 2025

    (13)
  4. 4.
    (i) Describe the working principle of open Hashing Technique and provide the type declaration in C for open hash table (ii) Consider a list of size 20 (m = 20). The elements are {96, 48, 63, 29, 87, 77, 48, 65, 69, 94, 61}. Display the Hash Table using double hashing technique. (iii) State the advantage of Quadratic Probing.

    Asked in Apr/May 2025

    (13)

UNIT 5Sorting and Searching Techniques

Most asked topics: Insertion Sort (6/7) · Quick Sort (6/7) · Linear Search (6/7) · Binary Search (6/7) · Heap Sort (4/7) · Merge Sort (4/7)

Part A · 2 marks

  1. 1.
    What is the time complexity of quick sort?

    Asked in Apr/May 2026

    (2)
  2. 2.
    Write down the difference between linear search and binary search.

    Asked in Apr/May 2026

    (2)
  3. 3.
    What is the worst case time complexity of Insertion sort and when it will occur?

    Asked in Apr/May 2025

    (2)
  4. 4.
    Find the time complexity and space complexity of the following code #include <stdio.h> void main() { int i, n = 8; for(i = 1; i<=n; i++) { printf("Hello World !!!\n"); } }

    Asked in Apr/May 2025

    (2)
  5. 5.
    Define insertion sort, Give an example.

    Asked in Nov/Dec 2024

    (2)
  6. 6.
    Explain the term binary search.

    Asked in Nov/Dec 2024

    (2)

Part B · 13 marks

  1. 1.
    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.

    Asked 2 times: Apr/May 2024, Nov/Dec 2023

    (13)
  2. 2.
    Compare and explain insertion sort, selection sort, and bubble sort with time complexities.

    Asked in Apr/May 2026

    (13)
  3. 3.
    Explain the logic of merge sort with an example. Also write a C program to implement merge sort on an array of integers.

    Asked in Apr/May 2026

    (13)
  4. 4.
    (i) Perform the insertion sort on the following elements and show the various passes to do it. The elements are 39,9,45,63,18,81,108,54,72,36 (ii) Explain the working principle of Merge Sort algorithm. (iii) Compare heap sort and quick sort.

    Asked in Apr/May 2025

    (13)

PART CAny unit

Part C · 15 marks

  1. 1.
    Design a student record management system in C using structures. The structure should store student rollno, name, dob, and CGPA. Write menu driven functionalities using array of objects to perform record creation, search and display list of students with CGPA ≥ 8.

    Asked in Apr/May 2026

    (15)
  2. 2.
    Create a doubly linked list and write algorithms for following task. (i) Insert node at the end (ii) Search a node (iii) Delete first node (iv) Insert a node after a specified element.

    Asked in Apr/May 2026

    (15)
  3. 3.
    (i) Develop a "C" program to store and read employee data in a binary File using structures. The file may have the fields Employee id and name. (ii) Convert the expression given below into its corresponding postfix expression and then evaluate it. Also write a program to evaluate a postfix expression. 10+((7-5)+10)/2.

    Asked in Apr/May 2025

    (15)
  4. 4.
    (i) Create a binary search tree with the input given below: 98, 2, 48, 12, 56, 32, 4, 67, 23, 87, 23, 55, 46 (1) Insert 21, 39, 45, 54, and 63 into the tree (2) Delete values 23, 56, 2, and 45 from the tree (ii) Sort the elements 81, 89, 9, 11, 14, 76, 54, 22 using HeapSort and explain the steps involved in it.

    Asked in Apr/May 2025

    (15)
  5. 5.
    (i) Your friend writes a C program to separate words present in a string "Good Morning Students" as shown below help him by completing the missing statements in the Program (Missing statements are indicated as ------------ in the program). …

    Asked in Nov/Dec 2024

    (15)
  6. 6.
    Write a C program that performs the following operations using inbuilt functions. (i) Find the remainder of a division operation. (ii) Find the quotient of a division operation. (iii) Find the square of a number. (iv) Find the square root of a number. (v) Find the cube value of a number.

    Asked in Nov/Dec 2024

    (15)

A question asked once is no guarantee for the next exam; cover the full CS3353 syllabus. Read the papers themselves:Apr/May 2026, Apr/May 2025, Nov/Dec 2024, Apr/May 2024, Nov/Dec 2023, Apr/May 2023, Nov/Dec 2022.