DS Lesson Plan-2024-25
DS Lesson Plan-2024-25
FMTH0301/Rev.5.3
Course Plan
Semester: II Year: 2024-25
The Data Structures course provides an in-depth exploration of how data is efficiently organized,
stored, and manipulated. It covers key data structures such as arrays, linked lists, stacks, queues,
graphs, and trees. The course emphasizes the importance of selecting and applying the most suitable
data structures to address real-world challenges effectively. The course is a prerequisite for Design and
Analysis of Algorithms, Discrete Mathematical Structures, Operating Systems Principles and
Programming, Principles of Compiler Design and Computer Networks.
Prerequisites:
C Programming language.
Page 1 of 29
School of Computer Science & Engineering
Program Outcomes
Course Outcomes (COs) / Program
Outcomes (POs)
1 2 3 4 5 6 7 8 9 10 11 12
E.g.: 1.2.3: Represents Program Outcome ‘1’, Competency ‘2’ and Performance Indicators ‘3’.
Page 2 of 29
School of Computer Science & Engineering
Competency PI CSPI
1.1.1: Apply fundamental Concepts of 1.1.1.1: Apply set theory
Mathematics: elements of set operations to solve graph
1.1:Demonstrate theory, logic, functions and relations problems.
competence in
and discrete structure concepts:
mathematics 1.1.1.2: Apply discrete structure
graphs, trees, counting, discrete
concepts to efficiently solve tree-
probability in problem solving.
based problems.
1.4.1.1: Apply knowledge of
Programming Concepts to solve
problem effectively.
1.4.1.2: Apply a suitable linked
list and its operations to develop
a solution for a problem.
1.4: Demonstrate 1.4.1: Apply suitable data structures 1.4.1.3: Apply the suitable stack
competence in and programming paradigm to solve operations to solve the given
computer science problems. problem effectively.
engineering knowledge. 1.4.1.4: Apply a suitable Queue
and its operations to develop a
solution for a problem.
1.4.1.5: Apply tree operations to
effectively solve the given
problem.
2.1: Demonstrate an 2.1.2:Identify processes, modules
2.1.2.1: Identify input output
ability to identify and ,variables, and parameters of
parameters, structure variables
characterize an computer based system to solve the
and modules to solve a problem.
engineering problem problems
Page 3 of 29
School of Computer Science & Engineering
Course Content
Text Books
1. Data Structures Using C and C++ - Y. Langsam, M. Augensteinand A. M. Tenenbaum, Prentice -
Hall of India Pvt. Ltd. Edition- 2, 2020
2. Data Structures with C -- Seymour Lipchitz, Tata McGraw Hill India LTD, EdItion-1, 2011
3. Kenneth H Rosen, Discrete Mathematics and its applications, 7ed, McGraw-Hill.
Reference Books:
1. Data Structures and Algorithms Made Easy – NarshimanKarumunchi, Career Monk Publications,
Edition-2, 2017.
2. Data Structure Through C - Yashavant P Kanetkar, BPB Publication, Edition-2.
3. Problem Solving in Data structures and Algorithms Using C – Hemath Jain, TaranTechnologies
Private Limited, Edition-1, 2016
4. Introduction to Algorithms - Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and
Clifford Stein. The MIT Press, Edition-3, 2009.
5. Data Structures through C in Depth, S.K. Srivastava, DeepaliSrivastava, BPB Publications, 2004
6. Online platform: www.Hackerrank.com
7. https://www.geeksforgeeks.org/
Page 4 of 29
School of Computer Science & Engineering
Evaluation Scheme
Note
1. Each Question carries 20 marks and may also consists of sub-questions.
2. Mixing of sub-questions from different chapters within a unit (only for Unit I and Unit II) is allowed in
ISA-I, II and ESA.
3. Answer 5 full questions of 20 marks each (Two full questions from Unit I, Unit II and One full question
from Unit III) out of 8 questions in ESA.
Page 5 of 29
School of Computer Science & Engineering
Page 6 of 29
School of Computer Science & Engineering
Learning Outcomes: -
At the end of the topic the student should be able to:
Lesson Schedule
Class No. - Portion covered per hour / per Class
1. Review of C: Structures
2. Array of Structures
3. Nested Structures
4. Pointers
5. Dynamic Memory Allocation
6. Introduction to Data Structures
Review Questions
Sl.No. - Questions TLOs BL PI Code
1. Describe with examples, the different ways of assigning values to 1 L2 1.4.1
structure members.
2. Describe the different approaches that can be used to pass 1 L2 1.4.1
structures as function arguments.
3. Create a structure that can describe a restaurant. It should have 3 L3 1.4.1
members that include the name, address, average cost, and type
of food. Write a function that displays all restaurants of a given
food type in order of cost, with the least costly first.
4. Explain Dynamic memory allocation with an example. 2 L2 1.4.1
5. For the following set of sample data, write a modular C program 2 L2 1.4.1
using pointers to compute the standard deviation and the mean.-6,
-12, 8, 13, 11, 6, 7, 2, -6, -9, -10, 11, 10, 9, 2
6. Marks obtained by a batch of students in the Examination 2 L2 1.4.1
tabulated as follows:
Student name Marks obtained
Page 7 of 29
School of Computer Science & Engineering
Laxmi 70 80 83 87
Vivek 77 89 90 96
… ……
Write a modular C program using pointer to compute the total
marks obtained by each student and print the rank list.
7. The area of a triangle can be computed by the sine law when 2 2 L3 1.4.1
sides of the triangle and the angle between them are known. Area
= (1 / 2) ab sin ( angle ) .Given the following 6 triangular pieces of
land, write a modular C program using pointers to find their area
and determine which is largest.
Plot No a b angle
1 137.4 80.9 0.78
2 155.2 92.62 0.89
3 149.3 97.93 1.35
4 160.0 100.25 9.00
5 155.6 68.95 1.25
6 149.7 120.0 1.75
#define SIZE 10
int sum(int ar[], int n); int sum(int ar[], int n) // how big an array?
int main(void) {
{ int i;
Int marbles[SIZE] = int total = 0;
{20,10,5,39,4,16,19,26,31,20}; for( i = 0; i< n; i++)
int answer; total += ar[i];
answer = sum(marbles, SIZE); printf("The size of ar is %d
printf("The total number of bytes.\n", sizeof(ar));
marbles is %d.\n", answer); return total;
printf("The size of marbles is %d }
bytes.\n",sizeof(marbles));
return 0;
}
Page 8 of 29
School of Computer Science & Engineering
Learning Outcomes:
At the end of the topic the student should be able to:
Topic Learning Outcomes COs BL CA Code
1. Explain memory representation of Linked list. 1 L2 1.4
2. Differentiate between arrays and linked lists. 1 L2 1.4
Lesson Schedule
Class No. - Portion covered per hour / per Class
1. Concept of Lists and its representation
2. Variants of list: Singly Linked List
3. Singly Linked List contd….
4. Circular Singly Linked List
5. Circular Singly Linked List contd….
6. Doubly Linked List
7. Doubly Linked List contd….
8. Circular Doubly Linked List
9. Circular Doubly Linked List contd….
10. Applications of linked list
Review Questions
3. Mention two real-world applications of linked lists and explain two 3 L2 1.4.1
major advantages of doubly linked lists over singly linked lists
Page 9 of 29
School of Computer Science & Engineering
4. Write a C program to implement a singly linked list with the following 4 L2 1.4.1
functions:
i. Insert a new node at the beginning.
ii. Insert a node at the given position.
iii. Merge two Singly Linked Lists.
iv. Reverses the linked list.
5. You are developing the Fin Track banking application, where each 5 L3 1.4.1
user's transaction history is managed using a linked list. Each
transaction is stored as a node containing details like transaction ID,
date, and amount. The customer service team requires functionality to
traverse the list and generate reports by filtering transactions based
on amount. Write a modular C program that calculates total spending
from a list of transactions, ensuring that transaction histories remain
well organized and accessible.
6. Write a C program to implement a Circular singly linked list with the 4 L2 1.4.1
following functions:
i. Insert a new node at the end.
ii. Delete a node at the given position.
iii. Find the middle element of the List.
iv. Delete the first occurrence of a given key.
7. Design a system for managing customer support tickets where each 5 L3 2.1.2
ticket is processed in a continuous cycle for a fixed time. If a ticket
remains unresolved within that time, it is revisited after all other tickets
have been processed. Resolved tickets are removed from the system,
and the cycle repeats until all tickets are addressed. Implement a
modular C program to simulate this scenario, ensuring fairness and
efficiency in handling tickets.
Page 10 of 29
School of Computer Science & Engineering
11. Advik wants to create a personalized playlist of his favorite songs for 5 L3 2.1.2
an uninterrupted listening experience. He should be able to view all
the songs in the playlist, remove any song that he dislikes, and see
the updated playlist count. Additionally, the playlist should support a
repeat mode, ensuring seamless playback by automatically looping
from the last song back to the first and vice versa. Write a modular C
program to implement these features efficiently.
12. The management in a Kabaddi match featuring Haryana and 5 L3 2.1.2
Karnataka teams decides to form a unified team by selecting players
alternately from each team. Write a modular C program to facilitate
the management in organizing the combined team.
Input:
List 1: 1 3 4 7 List 2: 2 6 9 1
Output : 1 2 3 6 4 9 7 1
Page 11 of 29
School of Computer Science & Engineering
Learning Outcomes:-
At the end of the topic the student should be able to:
Lesson Schedule
Class No. - Portion covered per hour / per Class
1. Stack: Definitions and Examples
2. Representing Stacks in C
3. Applications: Infix to postfix conversion
4. Applications: Evaluation of postfix expression
5. Applications: Parenthesis matching
6. Linked Implementation of Stacks
7. Linked Implementation of Stacks contd..
8. Recursion
Review Questions
Page 12 of 29
School of Computer Science & Engineering
push(5)
push(10)
push(15)
pop()
push(20)
pop()
push(25)
"(())"
"(())()"
"(())("
"(()"
5. Reverse the string "hello" using a stack. Show content of the stack 2 L3 1.4.1
after each step and the final result
6. Gagan, a student of XII standard, has a habit of reading 3 L3 2.1.2
newspapers (like Deccan, Hindu, and Times etc.) every day. He
doesn’t read the same newspaper on two consecutive days.
After reading a newspaper on a day, he used to keep that
newspaper in a tray. Second days’ newspaper will be kept on top of
first day newspaper; similarly, Nth day newspaper will be kept on
top of N-1th days’ newspaper. Allow any number of newspapers.
Write a modular C program to determine the total amount Gagan
has spent on a specific newspaper and count the number of
‘Deccan’ newspapers he has read.
7. Write a modular C program to convert a given infix expression to its 4 L3 1.4.1
equivalent postfix expression.
8. Write a modular C program to evaluate a given postfix expression. 5 L3 1.4.1
10. A company “AppiVa” with M number of initial employees would like 3 L3 2.1.2
to hire fresh candidates and advertises about this in well-known job
seeking websites. The selection is standardized so that the
deserved candidates are hired. In the initial process the company
receives resumes of ‘N’ candidates. The candidates are selected if
their CGPA is between 7.00 to 8.50(including both). The company
may also face recession and tries to implement layoffs, where in the
‘Seniority policy’ which means employees who have joined the
company most recently will have to exit the company first. i.e. last
hired is first fired. To overcome recession, the company fires Y
number employees based on last hired is first fired.
Page 13 of 29
School of Computer Science & Engineering
Input Format
Constraints
M>0
N>=0
Y>=0
CGPA>=7.00 and CGPA<=8.50
Output Format
11. How can we keep multiple containers of different sizes one inside 3 L3 2.1.2
another? Providing that all containers must be closed at the end?
Thinking????
Assume that there are N containers. First take the biggest container
but keep it open, keep the second biggest container in the first
container, but keep second container open , keep the third biggest
container in the second
biggest container, but keep the third container open , like that Nth
biggest container will be kept in N-1th biggest container.
After that we need to start closing them in the reverse order of their
keeping. That is smallest container which is kept last must be closed
Page 14 of 29
School of Computer Science & Engineering
first, then the second smallest container, like that till the biggest
container is closed.
Keeping sequence: G 7 F 6 E 5 D 4 C 3 B 2 A1
Closing sequence: A 1 B 2 C 3 D 4 E 5 F 6 G 7
Keeping sequence: C 3 B 2 A1
Closing sequence: B 2 A 1 C 3
Keeping sequence: G 7 F 6 E 5 D 4 C 3 B 2 A1
Closing sequence: A 1 B 2 D 4 E 5 F 6 C 3 G 7
Input Format
Constraint
N should be between 1 to 9
Output Format
Page 15 of 29
School of Computer Science & Engineering
Sample input 0
12
Sample output 0
Invalid containers
Sample input 1
3
C 3 B 2 A1 [Note: this is opening/placing sequence of container.
Where C:name of the container and 3: unique Id of the biggest
container]
A 1 B 2 C 3[Note: this is closing sequence of container]
Sample output 1
Valid
Sample input 2
4
D4C3B2A1
A1D4C3B2
Sample output 2
Invalid
Page 16 of 29
School of Computer Science & Engineering
Learning Outcomes: -
At the end of the topic the student should be able to:
CA
Topic Learning Outcomes Cos BL
Code
1. Explain the fundamental concepts of queue. 1 L2 1.4
2. Differentiate between linear and circular queues. 1 L2 1.4
3. Demonstrate operations and applications of queues. 2 L3 1.4
4. Apply appropriate queue to develop a solution for a given problem. 3 L3 2.1
Lesson Schedule
Class No. – Portion covered per hour / per Class
1. Introduction to Queues: Definitions, representing Queues in C.
2. Variants of Queue: Linear queue.
3. Linear queue contd…..
4. Linear queue contd…..
5. Circular queue.
6. Circular queue contd…..
7. Applications of queue.
8. Linked implementation of Queues.
Review Questions
PI
Sl.No. – Questions TLOs BL
Code
1. Define queue? Explain the basic operations of queue. 1 L2 1.4.1
2. Differentiate between linear queue and circular queue? 2 L2 1.4.1
3. What are the limitations of an array based implementation compared 3 L3 1.4.1
to a linked list based implementation of queue?
Page 17 of 29
School of Computer Science & Engineering
A student who receives food leaves the line, while latecomers join at
the end of the queue. Write a modular C program to implement the
above scenario.
6. Design a modular C program to simulate an Emergency Room 4 L3 2.1.2
Triage System where patients are prioritized based on the severity of
their condition. The system should categorize patients into four
priority levels:
Critical (C) – Highest priority
Urgent (U)
Normal (N)
Low (L) – Lowest priority
Patients arrive at the emergency room and are added to a priority
queue. The doctor attends to patients based on priority, ensuring
that those in critical condition receive treatment first.
7. Vishnu and his friends decided to watch a Kannada movie during 4 L3 2.1.2
school hours in the afternoon. When they arrived at the theatre, they
noticed a long queue at the ticket counter. The ticket distribution
follows a First-Come, First-Served (FIFO) rule, meaning:
People join the queue at the end as they arrive.
Tickets are issued to those at the front of the queue.
Once a person gets a ticket, they exit the queue.
Write a modular C program to implement the above scenario.
8. A bank has implemented a token system to manage customer 4 L3 2.1.2
service efficiently. Customers arriving at the bank take a token and
wait in a queue to be served by the cashier. The bank follows a First-
Come, First-Served (FIFO) approach, ensuring that customers are
attended to in the order they arrive. Write a modular C program to
implement the above scenario.
9. A college computer lab has a single processor that runs multiple 4 L3 2.1.2
student programs using Round Robin Scheduling. Each program
gets a fixed time slice (quantum) of 4 milliseconds before the CPU
switches to the next program in the queue. Construct the Gantt chart
for the execution of the above processes using Round Robin
Scheduling with a time quantum of 4ms. Show the order in which
processes execute.
Determine the completion time (CT) for each process.
Page 18 of 29
School of Computer Science & Engineering
Learning Outcomes:-
At the end of the topic the student should be able to:
Lesson Schedule
Class No. – Portion covered per hour / per Class
1. Graphs: Definitions and examples of graph, Sub graphs, Components.
2. Graph Isomorphism, Vertex Degree, Euler Trails and Circuits,
3. Planar Graphs, Hamilton Paths and Cycles,
4. Graph Coloring and Chromatic Polynomials.
Review Questions
TLO BL PI
Sl.No. – Questions
s Code
1. Define a graph, degree of a vertex with an example. 1 L2 1.1.1
3. Define a subgraph, how many sub graphs with at least one vertex 2 L3 1.1.1
does the following graphs have
a) K3 b) K2 c) W4
4. What is graph isomorphism? Explain the necessary conditions for 3 L2 1.1.1
two graphs to be isomorphic with examples.
5. What are Hamiltonian paths and cycles? Explain with examples. 3 L2 1.1.1
Page 19 of 29
School of Computer Science & Engineering
Learning Outcomes: -
At the end of the topic the student should be able to:
Lesson Schedule
Class No. – Portion covered per hour / per Class
1. Definitions, Properties, examples, Rooted trees and Binary rooted trees
2. Preorder and postorder traversals, sorting
3. Spanning trees, prefix codes and weighted trees
4. Optimization and Matching
Review Questions
PI
Sl.No. – Questions TLOs BL
Code
1. What are the key properties of trees? Explain at least three 1 L2 1.1.1
properties
2. Define a rooted tree. How does it differ from a tree? 1 L2 1.1.1
Page 20 of 29
School of Computer Science & Engineering
8. Given the following rooted tree, determine the height of the tree and 1 L3 1.1.1
the depth of node G.
A
/|\
BC D
/\ |
E F G
9. For the given binary tree, perform inorder, preorder, and postorder 2 L3 1.4.1
traversals.
1
/\
2 3
/\ \
4 5 6
Page 21 of 29
School of Computer Science & Engineering
Minor-1
Model Question Paper for In-Semester Assessment-1 (ISA-1)
Course: Data Structures Semester: II
Course Code: 24ECSF103 Duration: 75 mins
Date of Exam: Divisions: A-F
2a. Explain the following dynamic memory allocation functions in brief. 04 1 L2 1 1.4.1
2c. Ram, a software engineer at Flipkart, has been tasked by his manager 08 3 L3 2 2.1.2
to develop a system for efficiently managing product details. The
system must be capable of adding new products at the beginning of
the product list and calculating the total cost of all products in the list.
Ram needs to define a structure to represent each product and
implement user-defined functions using appropriate linked list to
perform the operations.
Page 22 of 29
School of Computer Science & Engineering
3b 08 2 L2 1 1.4.1
Write a user defined functions for the following:
3c A train reservation system keeps track of train coaches, with each 08 3 L3 2 2.1.2
coach storing details. The system wants administrators to implement
user-defined functions using appropriate linked list to perform two key
operations: adding a new coach at the end of the train and navigating
through the list to view the details of the next or previous coach. This
structure makes it easy to manage and update the train's coach
information dynamically and ensures smooth navigation between
coaches.
Page 23 of 29
School of Computer Science & Engineering
1b Write a user defined functions to check the queue length and add a 08 2 L3 1 1.4.1
new element in to queue based on a priority.
1c HARSHA is an electronic shop in Hubballi. On the occasion of 08 2 L3 2 2.1.2
GANESH CHATURTHI, the shop displays a COUPON CONTEST
banner outside the shop. The banner shows the following details:
1. First prize--- CAR
2. second prize---BIKE
The shop gives a COUPON to all its N customers who visit the shop.
On the COUPON, the details like name of the customer, gender of the
customer (m or f) and a unique integer COUPON number are
registered.
The shop keeps all the N COUPONS one above another and staple
them. If the COUPON number is an even number then the customer
will get car as first prize. If the COUPON number is an odd number
then the customer will get bike as second prize.
On the last day of GANESH CHATURTHI, the shop opens the stapled
coupons one by one and its COUPON NUMBER will be checked and
its details will be displayed like below.
Write a C program to display the details of the customers who won the
prize.
Page 24 of 29
School of Computer Science & Engineering
2c A popular amusement park has two separate entry lines for visitors: 08 3 L3 1 2.1.2
1. Regular Ticket Line – For visitors with standard tickets (FIFO order).
2. Fast Pass Line – For visitors who purchased priority access (should
be given preference).
To ensure fairness, the park management decides to merge both lines
into a single queue in the following way:
•For every 1 Fast Pass visitor, 2 Regular Ticket visitors should be
allowed.
•If one of the lines runs out of people, the other line should continue
serving normally.
Design a queue-based system that merges both lines while
maintaining the above rules.
3a Illustrating the content of the stack after each step, evaluate the 04 2 L3 1 1.4.1
following postfix expression and display result.
abc*+d-
3b Write a user defined functions to reverse the queue and add a new 08 2 L3 1 1.4.1
element into circular queue.
3c A university's computer lab has a shared printer that receives multiple 08 3 L3 1 2.1.2
print requests from students. The printer processes these requests on
a first-come, first-served (FIFO) basis. However, if the queue gets too
long (more than 10 requests), the printer starts rejecting new requests
until some jobs are completed. You are responsible for adding Print
Requests, Processing Print Requests, handling cancellations. Write a
c program to solve the above problem.
Page 25 of 29
School of Computer Science & Engineering
2a List out any two applications of linked list and any 04 L1 L2 1 1.4.1
two advantages of doubly linked list over singly
linked list
Page 26 of 29
School of Computer Science & Engineering
UNIT II
Q.No Questions Marks CO BL PO PI Code
4.a What is priority queue? How does a priority queue 04 1 L2 1 1.4.1
differ from a linear queue.
Page 27 of 29
School of Computer Science & Engineering
Page 28 of 29
School of Computer Science & Engineering
UNIT - III
Q.No. Questions Marks CO BL PO PI
Code
a) K3 b) K2 c) W4
7c Describe an algorithm to check whether two graphs 08 1 L3 1 1.1.1
are isomorphic.
04 2 L2 1 1.4.1
8a Explain the properties of Trees.
Page 29 of 29