BANGALORE INSTITUTE OF TECHNOLOGY
An Autonomous Institution Under VTU
K R ROAD, V V PURA, BENGALURU-04
MODULE WISE QUESTION BANK
Data Structures and Applications Course Code: BCS304
Course Title:
Semester: III Academic Year: 2025-2026
Batch: 2024-2028
Module I
INTRODUCTION TO DATA STRUCTURES: Data Structures, Classifications
(Primitive & Non-Primitive), Data structure Operations Review of pointers and dynamic
Memory Allocation ARRAYS and STRUCTURES: Arrays, Dynamic Allocated Arrays,
Structures and Unions, Polynomials, Sparse Matrices, Representation of Multidimensional
Arrays, Strings
Text 1, 2
Book
Chapter Text Book 2: Chapter 1: 1.1 - 1.4
Text Book 1: Chapter 1:1.2 Chapter 2: 2.1 - 2.7
RBT 2, 3
RBT
[Link]. Questions COs
Level
Define Data Structures. Explain the classification of Data
1 1 2
Structures with a neat diagram?
2 Explain various operations of Data Structures? 1 2
Define Pointers? How to declare and initialize pointers, explain
3 1 2
with examples?
Write a C function to swap the contents of two variables using
4 2 2
pointers. Also write the associated main function?
Write a program in C to check whether the given string is a
5 2 2
palindrome or not using pointers?
Explain any five String Handling function supported by C with
6 1 2
syntax and example?
Define Pattern Matching? Write the Knuth Morris Pratt Pattern
7 Matching algorithm and apply the same to search the pattern 2 3
‘abcdabcy’ in the text ‘abcxabcdabxabcdabcy’
Could you explain what is meant by pattern matching, outline the
8 2 3
Knuth Morris Pratt (KMP) algorithm, and illustrate it by finding
occurrences of P = 'ABCDABD' in S = 'ABC ABCDAB
ABCDABCDABDE'?
Implement C functions to compare two strings, join two strings,
9 and reverse a given string, ensuring that no built-in functions are 2 2
used.
Differentiate between Static and Dynamic Memory Allocation.
10 With this knowledge, explain the different dynamic memory 3 2
allocation functions with the proper syntax and examples.
Develop a C program that accepts a set of numbers entered by the
11 user, stores them in memory allocated during program execution, 2 3
and determines which value in the collection is the greatest.
Write a C program to declare and access elements of a linear array.
12 2 2
Demonstrate how array indices correspond to memory addresses.
What is Linear Array? Discuss the representation of linear array
13 1 2
in memory?
Explain about the representation of two dimensional arrays in
14 1 2
memory?
Give Abstract Data Type (ADT) for arrays. How array can be
15 1 2
declared and initialized?
Write a menu driven program in C for the following array
operations:
16 i)Inserting an element (ELEM) at a given valid position 2 3
ii)Deleting an element at a given valid position
iii)Display of array elements
Define Structures? Explain the types of Structures with example
17 1 2
for each?
Develop and implement a C program using a self-referential
structure to create a simple linked list or a node-based data
18 2 2
structure. Explain how the self-referential structure enables
linkage between nodes.
Analyze the differences between Structure and Union in C
19 programming in terms of memory allocation, data access, and 3 2
usage.
Explain with examples, the use of following operators referring to
20 1 1
structures and pointers in C: i) dot ii) asterisk iii) arrow
Write a C program using both Structure and Union to store student
21 information. Analyze and explain how the memory usage and 3 2
value access differ during execution.
Compare and explain how Arrays and Structures differ in terms of
22 3 2
data storage and usage in C, with suitable illustrative examples.
Write a C program to demonstrate how an Array and a Structure
23 can be used to store student information. Explain how the two 2 2
differ in usage and memory representation.
Define nested structures and arrays of structures in C.
24 Implement a C program that uses both concepts to store and 2 2
display student information such as name, roll number, and marks.
Define the structure for the employee with the following fields:
Emp_id (integer), Emp_name (string), Emp_basics (float),
Emp_dept (string) and Emp_age (integer). Write the following
25 2 2
function to process the employee data:
i)Function to read an employee record
ii)Function to print an employee record
Demonstrate an Abstract Data Type (ADT) for a sparse matrix in
26 C. Implement a program to represent and display the sparse matrix 2 2
using the triple (row, column, value) form.
Implement a C function to find the transpose of a given sparse
27 2 2
matrix. Explain each step with suitable comments.
What is sparse matrix? Give the triplet for a given matrix and find
its transpose?
28 2 2
In computer science, polynomials are frequently used to model
various systems. Consider two polynomials:
29 A(x) = 2x^3 + 4x^2 + 3x + 1 and B(x) = 5x^2 + 2x + 6 2 2
(a) Represent both polynomials using arrays.
(b) Write a C program to perform addition.
Consider two polynomials A(x) = 2x¹⁰⁰⁰ + 1 and B(x) = x⁴ + 10x³
+ 3x² + 1. Analyze how both can be stored efficiently in a single
30 3 3
one-dimensional array. Show the array layout diagrammatically
and explain the logic of the C representation.
A weather monitoring system records the temperature of a city
every hour for 7 days. Write a program to i) store the temperature
31 2 3
readings in an array ii) find the highest, lowest and average
temperature of the week.
A class of student took a test in five subjects. Store their marks in
32 an array and write a program to i) compute total and average marks 2 2
of each student. ii) find the topper (highest total score).
A university needs to store details of students such as roll number,
name, marks in three subjects and total marks. Write a program to
33 store details for n students, Calculate and display the total and 2 2
average marks for each student, find the student with the highest
total marks.
Design a structure-based program to store and manage student
placement details (name, USN, company name, salary offered).
34 2 2
Display students placed in a particular company and find the
highest package.
You are required to design an algorithm that searches for a pattern
in a large text efficiently. The algorithm should avoid rechecking
35 3 3
characters of the text that have already been compared once.
Explain the approach and write the function for the same.
In an airline management system, direct flight routes between
cities are represented using a sparse matrix where 1 indicates a
flight from city A to city B. Since only a few flights exists, the
36 2 2
matrix is sparse. Write a program to represent this matrix in sparse
form and find its transpose using arrays to identify the return flight
routes.
In robotics path planning, polynomial equations are used to model
smooth paths.
Two paths are represented as:
37 Path1(x) = 2x⁴ + 3x² + x 2 3
Path2(x) = 4x³ + 2x² + 3
Write a function to add the paths and obtain the combined
motion equation.
In a plagiarism detection system, strings from two documents are
compared to identify matching sequences of words.
38 2 4
Explain how the KMP algorithm can be used to improve the
efficiency of substring comparison in this context.
An online search engine needs to match user queries with a large
list of stored keywords.
39 Discuss how KMP’s pre-processing helps reduce redundant 2 4
comparisons when matching multiple patterns against a
single query text.
A log monitoring tool needs to find all occurrences of a word in
a log file .
40 Explain how the KMP algorithm can help system administrators 2 4
to locate error keywords like “FAILURE” quickly in
large log files .