Question Paper Code : 40919
B.E./B.Tech. DEGREE EXAMINATIONS, NOVEMBER/DECEMBER 2024.
Second/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.
Mention any four primary Data types of C language.
- 2.
Find the error in the expression. int k=0.5;
- 3.
Define the syntax of structures.
- 4.
Point out the drawback of array size declaration in the beginning of a program.
- 5.
Define linked list.
- 6.
What operation does 'isEmpty( )' function performs?
- 7.
What are Binary trees?
- 8.
Where do you use double hash?
- 9.
Define insertion sort, Give an example.
- 10.
Explain the term binary search.
PART B — (5 × 13 = 65 marks)
- 11.(a)
Explain the different types of expressions and Statements in C programming.
- Or
- (b)
- (i)Write down a program to sort 30 numbers in ascending order in C programming.(8)
- (ii)Explain Recursive functions.(5)
- 12.(a)
- (i)Discuss about pointers.(5)
- (ii)Write a program to swap two numbers 10, 20 without using a third variable and by using pointers in C language.(8)
- Or
- (b)
Elucidate the various operations that could be performed in managing files in C programming and a list of relevant functions that could be possibly explored.
- 13.(a)
- (i)Write a short note on singly and doubly linked list.(6)
- (ii)Write a program to do insertion operation in the beginning of a doubly linked list.(7)
- Or
- (b)
Elucidate the features of Queue ADT and also mention the functions that may be used in queues. Give necessary illustrations.
- 14.(a)
- (i)Explore the properties of binary trees.(7)
- (ii)Explain the different tree traversal techniques.(6)
- Or
- (b)
- (i)Investigate the role of double hashing.(7)
- (ii)Explain binary search trees.(6)
- 15.(a)
Write a program for binary search with relevant Flow charts. Trace the algorithm for an array with 10 values.
- Or
- (b)
Analyze the steps of Quick sort algorithm by taking a relevant examples.
PART C — (1 × 15 = 15 marks)
- 16.(a)
- (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). #include<--------> #include<stdlib.h> int main( ) { char str1[---]= "Good Morning-----"; const char str[ ] = "", s[2]= " "; char *part; int counter=1; part = strpart(str1, s); while (part !=NULL) { printf("-----%d=%s\n", counter++,part); part = strpart(NULL,s); } return 0; } Output of program Part 1 = Good Part 2 = Morning Part 3 = Students(7)
- (ii)Write a C program to multiply two matrices of order mxp, pxn respectively.(8)
- Or
- (b)
Write a C program that performs the following operations using inbuilt functions.
- (i)Find the remainder of a division operation.(3)
- (ii)Find the quotient of a division operation.(3)
- (iii)Find the square of a number.(3)
- (iv)Find the square root of a number.(3)
- (v)Find the cube value of a number.(3)