Question Paper Code : 90921
B.E./B.Tech. DEGREE EXAMINATIONS, APRIL/MAY 2025.
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)
Answer ALL questions.
PART A — (10 × 2 = 20 marks)
- 1.
Define Data Types.
- 2.
Write a Program to find whether the given number is odd or even.
- 3.
State the purpose of "typedef' in C Programming.
- 4.
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)); }
- 5.
Why doubly linked list is more useful than a singly linked list.
- 6.
Name any two applications of priority queues.
- 7.
Write short note on Hash Table.
- 8.
State the importance of Sorting.
- 9.
What is the worst case time complexity of Insertion sort and when it will occur?
- 10.
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"); } }
PART B — (5 × 13 = 65 marks)
- 11.(a)
- (i)Write a program to find whether the entered character is a vowel or note.(5)
- (ii)Develop a program to print the position of the smallest number of "n" numbers using arrays.(5)
- (iii)Differentiate between while and do-while loops.(3)
- Or
- (b)
- (i)What are decision control statements? Explain with examples.(6)
- (ii)Given an array int marks[ ]={99,67,78,56,88,90,34,85}, calculate the address of marks[4] if the base address = 1000.(4)
- (iii)Differentiate between call by value and call by reference.(3)
- 12.(a)
- (i)How a structure can be created by initializing the variables and how it can be accessed.(4)
- (ii)Write a program to find smallest of three numbers using structures.(5)
- (iii)Differentiate between structure and array.(4)
- Or
- (b)
- (i)Differentiate between a binary file and a text file.(4)
- (ii)Specify the various attributed that can be used in a file system.(5)
- (iii)Write a program to add two integers using pointers and functions.(4)
- 13.(a)
- (i)Create a linked list which stores names of the employees. Then sort these names and re-display the contents of the linked list.(5)
- (ii)Give the linked representation of the following polynomial: 7x^3y^2 - 8x^2y + 3xy + 11x - 4.(4)
- (iii)Write an algorithm for evaluation of a prefix expression.(4)
- Or
- (b)
- (i)Devise an algorithm to insert and delete an element from a linked queue.(5)
- (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.(5)
- (iii)Differentiate between peek() and pop() functions.(3)
- 14.(a)
- (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.(4)
- (ii)Explain the steps involved in the multiplication method of hash function.(4)
- (iii)Calculate the hash value for keys 1234 and 5642 using the mid-square method. The hash table has 100 memory locations.(5)
- Or
- (b)
- (i)Describe the working principle of open Hashing Technique and provide the type declaration in C for open hash table(5)
- (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.(5)
- (iii)State the advantage of Quadratic Probing.(3)
- 15.(a)
- (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(5)
- (ii)Explain the working principle of Merge Sort algorithm.(4)
- (iii)Compare heap sort and quick sort.(4)
- Or
- (b)
- (i)If the following sequence of numbers is to be sorted using quick sort, then show the iterations of the sorting process. 42, 34, 75, 23, 21, 18, 90, 67, 78.(5)
- (ii)Using Binary Search, search the number 26 from the list of numbers and give its steps. The numbers are 10,7,17,26,32,92.(5)
- (iii)Compare Binary Search and Linear Search.(3)
PART C — (1 × 15 = 15 marks)
- 16.(a)
- (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.(8)
- (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.(7)
- Or
- (b)
- (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(8)
- (ii)Sort the elements 81, 89, 9, 11, 14, 76, 54, 22 using HeapSort and explain the steps involved in it.(7)