// Anna University, Chennai / 2025
Anna University — C Programming and Data Structures (CS3353), November/December 2025
C Programming and Data Structures · CS3353 · R2021 · B.E. Electronics and Communication Engineering · Semester 3
Work through the questions
16 questions
No verified answers are available for this paper.
C Programming and Data Structures
Arrange the given operators in the order of their precedence (high to low): &&, %, <<, [], ++.
No verified answer or solution is available for this question.
C Programming and Data Structures
Mention the formulae for locating the (i,j)th element in a 2-D array Arr[M][N] using row-major and column-major methodology, possessing the base address a.
No verified answer or solution is available for this question.
C Programming and Data Structures
List the difference between the file opening modes 'r', 'r+'. What happens if the file already exists?
No verified answer or solution is available for this question.
C Programming and Data Structures
Develop a C code snippet that removes all duplicates from an array.
No verified answer or solution is available for this question.
C Programming and Data Structures
Draw a diagram that represents a doubly linked list that is empty but contains only the header node.
No verified answer or solution is available for this question.
C Programming and Data Structures
Assume the following conditional statement: if (Front == Rear), then ['Queue is Empty'] or ['contains one element']. Which conditional statement is correct? Justify your answer.
No verified answer or solution is available for this question.
C Programming and Data Structures
Write recursive procedures for in-order traversals. Give an example.
No verified answer or solution is available for this question.
C Programming and Data Structures
How can collision resolution be executed within the context of hashing? Provide a suitable example to support the stated point.
No verified answer or solution is available for this question.
C Programming and Data Structures
Give an algorithm to find the kth largest value in a BST.
No verified answer or solution is available for this question.
C Programming and Data Structures
What is the idea behind selection sort? Perform selection sort for the following input instance: 41, 3, 55, 62, 71, 2, 9, 8, 4.
No verified answer or solution is available for this question.
C Programming and Data Structures
(a) Piglatin is an encoded form of English that is often used by children as a game. A Piglatin word is formed from an English word by transposing the first sound (usually the first letter) to the end of the word and then adding the letter "a". Thus, the word "dog" becomes "ogda", "computer" becomes "omputerca", and "piglatin" becomes "iglatinpa" (or "igpa atinla", if spelled as two separate words), and so on. Develop a C program that accepts a line of English text (char array) and then prints out the corresponding text in Piglatin. (OR) (b) Write C code to check whether the given 3 × 3 integer array is a magic square or not. A magic square is a square grid (where n is the number of cells on each side) filled with distinct positive integers in the range such that each cell contains a different integer and the sum of the integers in each row, column and diagonal is equal.
No verified answer or solution is available for this question.
C Programming and Data Structures
(a) Write a C program using a 2D array to read the marks of 5 students in 4 subjects. Display the total marks and average obtained by each student. (13 marks) (OR) (b) Assume a structure named Stud holds the details of undergraduate students. Develop a C program to save the roll number (beginning from 1), name, and age of five students into a file named stud_info. Then read the file and display the details of the student with roll number 2.
No verified answer or solution is available for this question.
C Programming and Data Structures
(a) Write sample C functions that perform the following operations in a linked list. (i) Insert a new node at the front. (3 marks) (ii) Reversal of linked list nodes. (3 marks) (iii) Deletion at front. (3 marks) (iv) Deletion at the end of a linked list. (4 marks) Assume Head is a pointer that points to the first node of the linked list. (OR) (b) Assume that every string is represented in the form of a linked list in which each and every node holds exactly one character. Write a C code snippet to check whether the given string pat is a substring of another string str.
No verified answer or solution is available for this question.
C Programming and Data Structures
(a) What are binary search trees (BST)? Devise a C code snippet that searches for a particular element in a BST. What would be the average number of nodes it has to search to find a particular key when the search starts from the root to the leaf? Also develop a C code snippet to delete a leaf node having the value val from a BST. (OR) (b) Devise an iterative function in C to perform post-order traversal in a given binary tree. Indicate the operations performed in the user-defined stack in the course of your algorithm or program execution.
No verified answer or solution is available for this question.
C Programming and Data Structures
(a) Give a C code snippet that performs partition-exchange (quick) sort and use it to sort the following numbers: 73, 14, 52, 1, 2, 6, 99, 91, 98, 48, 74, 72, 5, 7, 100. Show the stages of arrangement of numbers along with the pivot element while sorting the above numbers. (10 marks) Mention the recurrence relation and derive its time complexity for the above presented algorithm. (3 marks) (OR) (b) Give a C code snippet that performs a two-way merge sort. Using the working code, sort the following numbers and show how the divide-conquer and combine strategies are followed: 73, 14, 52, 1, 2, 6, 99, 91, 98, 48, 74, 72, 5, 7, 100. (10 marks) Mention the recurrence relation for the given algorithm and derive it to justify that it runs in logarithmic scale. (3 marks)
No verified answer or solution is available for this question.
C Programming and Data Structures
(a) (i) Write an algorithm to perform polynomial addition using linked lists. (8 marks) (ii) Write a function that deletes m nodes after k nodes in a given linked list. (7 marks) (OR) (b) There are three types of edits that can be performed on strings: insert a character, remove a character, or replace a character. Given two strings in the form of linked lists where each node holds exactly one character, write C functions to check if they are one edit away or zero edits away, satisfying all the prescribed test cases below. (i) pale, ple — TRUE (3 marks) (ii) pales, pale — TRUE (4 marks) (iii) pale, bale — TRUE (4 marks) (iv) pale, bae — FALSE (4 marks)
No verified answer or solution is available for this question.