You are on page 1of 6

Data Structures & Applications (BCS304) Question Bank – Module 1

MODULE - 1
Introduction to Data Structures, Review of Pointers & Dynamic Memory
Allocation, Review of Arrays and Structures, Stacks

Q. No. Questions COs CL Marks

1 Define data structures. Explain the classification of data structures CO1 L2 8M


with examples. What are the primitive operations that can be
performed? (July 2023) (August 2022) (March 2022)
2 Write an algorithm to insert an element into an array and delete an CO1 L2 7M
element from the array. (July 2023)

3 Explain user defined structures with respect to C. give structure CO1 L2 4M


definition and declaration for STUDENT data with USN and Name.
Also, give self-referential structure. (July 2023)
4 Show an array representation of Polynomial. Write a C function to CO1 L2 8M
add two polynomials A(x) and B(x) term by term to produce
𝐷(𝑥) = 𝐴(𝑥) + 𝐵(𝑥)
𝐴(𝑥) = 2𝑥10 + 𝑥 + 3 and 𝐵(𝑥) = 𝑥 5 + 10𝑥 3 + 3𝑥 2 + 12
𝐴(𝑥) = 4𝑥15 + 3𝑥 4 + 5 and 𝐵(𝑥) = 𝑥 4 + 10𝑥 2 + 1.
(July 2023)
5 Obtain triplet representation for the given sparse matrix. Apply fast CO1 L3 8M
transpose algorithm to obtain transpose of sparse matrix.
15 0 0 22 0 −15
0 11 3 0 0 0
0 0 0 −6 0 0
0 0 0 0 0 0
91 0 0 0 0 0
[0 0 28 0 0 0 ]
(July 2023)

Department of AI & ML, Vemana IT Prepared by: Dr. Kantharaju H C Page 1 of 6


Data Structures & Applications (BCS304) Question Bank – Module 1

10 0 0 25 0
0 23 0 0 45
0 0 0 0 32
𝐴=
42 0 0 31 0
0 0 0 0 0
0 0 30 0 0

15 0 0 22
0 11 3 0
0 0 0 −6
𝐴=
0 0 0 0
91 0 0 0
0 0 28 0
6 What is Linear Array? Discuss the representation of linear array in CO1 L2 6M
memory. (Jan 2023)

7 Differentiate between static and dynamic memory allocations. CO1 L2 6M


Explain the dynamic memory allocation functions supported by 'C'
with syntax and examples. (Jan 2023) (August 2022)
8 Write a menu driven program in C for the following array CO1 L2 8M
operations.
i. Inserting an element at a given valid position
ii. Deleting an element at a given valid position
iii. Display an array element.
iv. Exit
Support the program with functions for each of the above
operations. (Jan 2023)
9 Give Abstract Data Type (ADT) for arrays. How arrays can be CO1 L2 6M
declared and initialized. (Jan 2023)

10 With suitable example, discuss self-referential structures. CO1 L2 6M


(Jan 2023)
11 Define sparse matrix. How to represent a sparse matrix? Write an CO1 L2 8M
algorithm/function to transpose a given Sparse matrix.
(Jan 2023)
12 Define Stack. Discuss how to represent stack using dynamic arrays. CO1 L2 8M
(Jan 2023)

Department of AI & ML, Vemana IT Prepared by: Dr. Kantharaju H C Page 2 of 6


Data Structures & Applications (BCS304) Question Bank – Module 1

13 Develop a menu driven Program in C for the following operations CO1 L3 8M


on STACK of Integers (Array Implementation of Stack with
maximum size MAX)
a) Push an Element on to Stack
b) Pop an Element from Stack
c) Demonstrate how Stack can be used to check Palindrome
d) Demonstrate Overflow and Underflow situations on Stack
e) Display the status of Stack
f) Exit
Support the program with appropriate functions for each of the
above operations
14 What is recursion? Write a recursive function to solve Towers of CO1 L2 8M
Hanoi problem. Trace the algorithm for the total of 3 disc which are
placed in source pole. (Jan 2023)
15 Write an algorithm to convert an infix expression to postfix CO1 L2 8M
expression. Show the content of the stack to convert the following
infix expression.
𝐴 ∗ (𝐵 + 𝐷)/𝐸 − 𝐹 ∗ (𝐺 + 𝐻/𝐾)
𝐴 + (𝐵 ∗ 𝐶 − (𝐷/𝐸^𝐹) ∗ 𝐺) ∗ 𝐻
((𝐴 + (𝐵 − 𝐶) ∗ 𝐷)^𝐸 + 𝐹)
𝑋$𝑌$𝑍−𝑀+𝑁+𝑃/𝑄
(𝑎 + 𝑏) ∗ 𝑑 + 𝑒 / 𝑓 + 𝑐
(𝐴 + 𝐵 ∗ 𝐶) ∗ ((𝐷 + 𝐸 − 𝐹) / 𝐽
𝐴 $ 𝐵 ∗ 𝐶 − 𝐷 + 𝐸 / 𝐹 / (𝐺 + 𝐻)
16 Write an algorithm to convert an infix expression to prefix CO1 L2 7M
expression. Apply the algorithm to obtain equivalent prefix
expression.
6 ∗ 2 ^ 2 ^ 3/(9 − 3)
+(𝐵 ∗ 𝐶 − (𝐷/𝐸^𝐹) ∗ 𝐺) ∗ 𝐻
((𝐴 + (𝐵 − 𝐶) ∗ 𝐷)^𝐸 + 𝐹)
𝑋$𝑌$𝑍−𝑀+𝑁+𝑃/𝑄
(𝑎 + 𝑏) ∗ 𝑑 + 𝑒 / 𝑓 + 𝑐
(𝐴 + 𝐵 ∗ 𝐶) ∗ ((𝐷 + 𝐸 − 𝐹) / 𝐽

Department of AI & ML, Vemana IT Prepared by: Dr. Kantharaju H C Page 3 of 6


Data Structures & Applications (BCS304) Question Bank – Module 1

𝐴 $ 𝐵 ∗ 𝐶 − 𝐷 + 𝐸 / 𝐹 / (𝐺 + 𝐻)

17 With the help of algorithm, evaluate the postfix expression using


stack.
6223^^ ∗ 3/
651−4∗23^/+
546+∗493/+ ∗
𝐴 𝐵 𝐶 − 𝐷 ∗ +𝐸 $ 𝐹 +
Assume A=6, B=3, C=2, D=5, E=1 and F=7
18 Differentiate between structures and unions. Show examples for CO1 L2 8M
both. (August 2022)
19 Explain the representation of linear arrays in memory. Also, CO1 L2 8M
consider the linear arrays AAA (5:50) and BBB(-5:10).
i. Find the number of elements in each array.
ii. Suppose Base (AAA) = 300, Base (BBB) 500 and 4 words per
memory cell for AAA, 2 words per memory cell for BBB, find
the address of AAA[15], AAA[55], BBB[8] and BBB[0].
(August 2022)
20 Define Structures. Explain the types of structures with examples for CO1 L2 7M
each. (March 2022)
21 Write a program to search for key element in an array using binary CO1 L2 7M
search. (August 2021)
22 Write a program to sort integers in increasing order using selection CO1 L2 6M
sort algorithm. (August 2021)
23 Write a program to search for an element in the sparse matrix. CO1 L1 6M
(August 2021)
24 Define pointers. List the advantages of pointers over arrays. CO1 L2 7M
(September 2021)
25 What is structure? How it is different from array? Explain different CO1 L2 6M
types of structure declaration with examples and give differences
between Union and Structure.
26 Write the bubble sort algorithm with an example. CO1 L2 6M

Department of AI & ML, Vemana IT Prepared by: Dr. Kantharaju H C Page 4 of 6


Data Structures & Applications (BCS304) Question Bank – Module 1

27 Write C function to search an element using binary search CO1 L2 8M


alogortihm.

28 What is polynomial? What is the degree of the polynomial? Write a CO1 L2 8M


program to add two polynomials.

29 Develop a Program in C for the following operations on Strings. CO1 L3 8M


a) Read a main String (STR), a Pattern String (PAT) and a
Replace String (REP)
b) Perform Pattern Matching Operation: Find and Replace all
occurrences of PAT in STR with REP if PAT exists in STR.
Report suitable messages in case PAT does not exist in STR
Support the program with functions for each of the above
operations. Don't use Built-in functions.
30 Develop a Program in C for the following: CO1 L3 8M
a) Declare a calendar as an array of 7 elements (A dynamically
Created array) to represent 7 days of a week. Each Element of
the array is a structure having three fields. The first field is the
name of the Day (A dynamically allocated String), The second
field is the date of the Day (A integer), the third field is the
description of the activity for a particular day (A dynamically
allocated String).
b) Write functions create(), read() and display(); to create the
calendar, to read the data from the keyboard and to print
weeks activity details report on screen.
31 Develop a Program in C for the following Stack Applications CO1 L3 8M
a) Evaluation of Suffix expression with single digit operands and
operators: +, -, *, /, %, ^
b) Solving Tower of Hanoi problem with n disk
32 Develop a Program in C for converting an Infix Expression to CO1 L3 8M
Postfix Expression. Program should support for both parenthesized
and free parenthesized expressions with the operators: +, -, *, /, %
(Remainder), ^ (Power) and alphanumeric operands.

Department of AI & ML, Vemana IT Prepared by: Dr. Kantharaju H C Page 5 of 6


Data Structures & Applications (BCS304) Question Bank – Module 1

Course Faculty

Department of AI & ML, Vemana IT Prepared by: Dr. Kantharaju H C Page 6 of 6

You might also like