Automatically extracted historical question data. Academic accuracy and examination rules require verification.
Part A — 1
Write down the output of the following code: 2 0௦01 |L3
void main()
{
int i, W, p;
char st[] = "WELL";
printf("\n");
for (i=0; i<4; i++)
{
p = i+1; printf(\n %5.*s", p, st);
}
printf("\n");
for (i=4; i>0; i--)
{
p = i+1; printf("\n %5.*s", p, st);
}
getch();
}
Other Or UnclassifiedSource quality review required
Part A — 2
Write down the output of the following program: 2 CO1 | L3
#include <stdio.h>
int func’ (int a)
{
if (a)
return func (--a)+a;
else
return 0:
int main()
int a = 7:
printf("%d" func1(a));
return 0:
}
How do you define a pointer to a function? Illustrate its usage with
an example.
CO2
L1
Write down the output of the following code:
int main()
int arr[5]= {1,2,3,4,5};
int *ptr = arr + 2;
printf("Y%d %d", --*ptr+1, 1+*—ptr);
return 0:
}
CO2
L3
Mention the significance of ADT.
CO3
L1
Simulate a Double ended queue of size n = 9, where insertion and
deletion takes place at both ends of the queue (REAR1 and
FRONT1 corresponds to one end of the queue and REAR2,
FRONT2 denotes the other end of the queue). Insert 54, 34, 67 and
45 at REAR1 and insert 26, 45, 32, 11 and 108 at REAR2. Delete
Other Or UnclassifiedSource quality review required
Part A — 2
elements from FRONT1 and delete 3 elements from FRONT2.
Display the status of the queue.
CO4
L4
How do you calculate the height and depth of a node in a tree?
Illustrate it with an example.
CO3
L1
Simulate the construction of an expression tree for the following
expression using Stack:
abe+cdg*-*+
CO4
L2
Simulate the process of performing Insertion sort for the following
set of numbers:
25 64 32 10 87 45 11 20
CO5
L2
10
Write a C program to perform Linear Search for the given set of
numbers. Write down its best and worst case complexity.
COS
L3
Other Or UnclassifiedSource quality review required
Part B — 11a
(a) (i)
Write a C program to find all the triplicate (which appears thrice in
an array) elements present in the array. In such cases, the array
should hold only one occurrence of the element and delete the two
more successive occurrences. Display the size of the resultant
array with its elements.
CO1
L3
(il)
Write a recursive function called print_backwards () which accepts
a series of characters from the keyboard as input and prints all the
characters backwards in the screen when terminated with a full-
CO1
L3
stop. (Characters should not get stored anywhere while accepting
it).
Other Or UnclassifiedSource quality review required
Part B — 11b
(b) (i)
Write a C program to accept a text passage from the user.
Replace every occurrence of the string “abba” by “accb” using
character manipulation functions.
01
L3
(il)
Write a C program that reads a 2-D matrix and displays the sum
of the elements above and below the main diagonal
correspondingly.
௦01
L3
Other Or UnclassifiedSource quality review required
Part B — 12a
(a) (i)
Create a cricket PLAYER using structure having Player ID, Player
Name, Number of matches played, Highest Score, Number of
centuries and Rating. Write suitable functions to perform the
following operations:
i) Create the PLAYER using memory allocation operator. Atleast
six players need to be created using array of pointers.
ii) Display the list of players details using array of pointers.
iii) Display the Player IDs with highest score in minimum number of
matches played.
iv) Update the Highest score rate, Number of matches played,
centuries obtained and Rating fields of the PLAYER if he obtains
additional runs in new matches.
01
02
L3
(ii)
Explain the different types of Preprocessor directives and its
significance with an example for each.
CO2
L1
Other Or UnclassifiedSource quality review required
Part B — 12b
(b) (i)
Write a C program to accept a STUDENT using structures having
Student ID, Student Name, DOB (create a nested structure with
day, month and year as attributes),Address and Marks obtained as
properties. Access the properties of STUDENT using suitable
pointer.
a) Accept atleast a minimum of 10 student details and
write it into a text file.
b) Open the text file in read mode and perform the
following operations:
1. Display the names of the students who are
elder than 20 years.
2. List out the Student IDs who are in the
same age.
3. Append the name of the student who has
secured higher marks at the end of the file.
601
602
L3
(il)
Illustrate the usage of Enumerated data types with a suitable C
program.
CO2
L1
Other Or UnclassifiedSource quality review required
Part B — 13a
(a) (i)
Write a C program to create a list which stores the student
registration number of a class where each node of the list possess
the address of the predecessor and successor.
Perform the following operations for the list created:
1. Students to be added into the list should wait in a Queue.
2. Add student registration number one by one into the list
by dequeueing it from the queue.
3. Arrange the elements in the queue in descending order
after every dequeue operation.
CO3
L5
4. Display the status of the queue and list after inserting the
student registration numbers.
(il)
Create a Recursion tree by illustrating the recursive calls involved
in the generation of Fibonacci series where number of terms = 6
CO4
L2
Other Or UnclassifiedSource quality review required
Part B — 13b
(b) (i)
Create a Singly linked list by inserting the character elements one
by one from a Stack data structure which is created using arrays.
(Frame a new name by concatenating all the characters present in
the list- Note: Name should contain atleast 7 characters) Perform
the following operations to construct the name from the list:
i. Second character of the name should be the second
largest element of the Stack.
ii. Fourth character of the name should be the last character
of the Stack.
iii. Sixth character of the name should be the topmost
character of the Stack.
iv. Remaining characters are fetched from the stack by
leaving the characters which are used already. Display the newly
formed name from the list.
CO3
L5
(il)
Convert the infix expression to postfix expression. Show the
simulation using Stack.
732%/32*+917%*-. Note that % is the exponentiation
operator.
CO4
L2
Other Or UnclassifiedSource quality review required
Part B — 14a
(a) (i)
Given the input {471, 132, 617, 419, 434, 967, 198, 256, 854} and
a hash function h(X) = X(mod 8), simulate and analyze the result
of constructing open addressing hash table with second hash
function h2(X) = 7-(X mod 7). Comment your opinion on it.
CO6
L4
(ii)
Show the result of inserting the elements 45, 36, 76, 23, 89, 115,
98, 39, 41, 56, 69, 48 into an initially empty binary search tree.
Write down the preorder and post order traversal of the final tree
constructed. Further simulate the result of deleting the elements
89, 41, 115 and 23.
CO3
L2
Other Or UnclassifiedSource quality review required
Part B — 14b
(b) (i)
Compare and analyze the various advantages and disadvantages
of collision resolution strategies in Open Addressing scheme with
suitable examples.
CO6
L4
(ii)
Write a C program to calculate the path length of the given nodes
present in a binary search tree.
CO3
L2
Other Or UnclassifiedSource quality review required
Part B — 15a
(a) (i)
Accept your name (First Name followed by Last name with space
in between both the names). Initial letter of the first name and last
name should be in Capital case.
Simulate an encoding scheme to toggle every third character of
your name into an upper case. Convert each character of your
resultant name into its corresponding ASCII code and populate the
array accordingly. (For example if the name is ABC, populate the
array with the integers 65, 66 and 67 correspondingly). Simulate
Merge sort operation in the above array to arrange the numbers in
ascending order. Also simulate the decoding process to display
and decode the characters from the sorted array.
CO5
L3
(il)
Write a recursive C program to sort the given elements using
Merge Sort.
COS
L2
Other Or UnclassifiedSource quality review required
Part B — 15b
(b) (i)
Accept your ambitious company name where you want to get
employed (Minimum of 12 characters).
Encode your company name with the following constraints:
Replace every odd character of your input by its adjacent
character and replace every even character with a neighboring
vowel (Neighboring vowel means the vowel that follows the
character subsequently in English alphabets). If the character itself
is a vowel, retain the same character. Simulate the process of
arranging the characters of the resultant name in alphabetical order
and display the result.
05
L3
(ii)
Sort the following numbers using Heap
Sort.
166 153 192 231 511 471 189 10888 100 191 115
131.
05
L2
Other Or UnclassifiedSource quality review required
Part C — 16
(i)
Using a suitable data structure, create an application (using C
code) named Book Index Search (BIS) which consists of Key
terms, Description of key terms and Page Number. Here Key terms
should be organized in a hierarchical manner based on their initial
occurrences of alphabets in key terms. The application should be
capable of performing the following operations:
a. Whenever a new term is introduced, it must be
added to the application with an appropriate key
term, description and corresponding page number.
b. When the key term is no longer used, its
corresponding entries must be removed from BIS.
c. If the key term is given as input, corresponding
description should get displayed appropriately.
10
CO2
CO4
L6
(ii)
For the application created in option (i),
Find out the key terms which are frequently searched. Display the
number of times each key term has been searched in descending
order.
CO2
CO4
L6
Other Or UnclassifiedSource quality review required