0% found this document useful (0 votes)
21 views29 pages

DS Lesson Plan-2024-25

The document outlines the course plan for 'Data Structures' (Course Code: 24ECSF103) offered by the School of Computer Science & Engineering for the academic year 2024-25. It details course content, prerequisites, outcomes, evaluation schemes, and teaching hours, emphasizing the importance of data structures in computer science. The course covers various data structures such as arrays, linked lists, stacks, queues, graphs, and trees, and is a prerequisite for several advanced courses.

Uploaded by

srhorakeri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views29 pages

DS Lesson Plan-2024-25

The document outlines the course plan for 'Data Structures' (Course Code: 24ECSF103) offered by the School of Computer Science & Engineering for the academic year 2024-25. It details course content, prerequisites, outcomes, evaluation schemes, and teaching hours, emphasizing the importance of data structures in computer science. The course covers various data structures such as arrays, linked lists, stacks, queues, graphs, and trees, and is a prerequisite for several advanced courses.

Uploaded by

srhorakeri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

School of Computer Science & Engineering

FMTH0301/Rev.5.3
Course Plan
Semester: II Year: 2024-25

Course Title: Data Structures Course Code : 24ECSF103


Total Contact Hours: 40 Duration of ESA :03 hours
ISA Marks: 50 ESA Marks:50
Lesson Plan Author:

Priyadarshini D.K, Vidya S Handur, Vijay Biradar Date:20-02-2025

Kavitha H.S, Shivalingappa.B, Sandeep K

Checked By: Dr. Padmashree Desai Date:20-02-2025

Brief description of the course:

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.

Course Outcomes (COs):

At the end of the course, the student should be able to:

1. Explain the fundamental concepts of linear and non-linear data structures.

2. Demonstrate properties, operations and applications of various data structures.

3. Apply appropriate data structures to develop a solution for a given problem.

Page 1 of 29
School of Computer Science & Engineering

Course Articulation Matrix: Mapping of Course Outcomes (COs) with Program


Outcomes (POs)
Course Title: Data Structures Semester: II
Course Code: 24ECSF103 Year: 2024-25

Program Outcomes
Course Outcomes (COs) / Program
Outcomes (POs)
1 2 3 4 5 6 7 8 9 10 11 12

1. Explain the fundamental concepts of


H M
linear and non-linear data structures.

2. Demonstrate properties, operations and


H H
applications of various data structures.

3. Apply appropriate data structures to


H H
develop a solution for a given problem.

Degree of compliance L: Low M: Medium H: High

Competency addressed in the Course and corresponding Performance Indicators

Competency Performance Indicators


1.1.1: Apply fundamental Concepts of Mathematics:
elements of set theory, logic, functions and relations
1.1:Demonstrate competence in mathematics
and discrete structure concepts: graphs, trees,
counting, discrete probability in problem solving.
1.4: Demonstrate competence in computer 1.4.1: Apply suitable data structures and
science engineering knowledge. programming paradigm to solve problems.
2.1.2: Identify processes, modules ,variables, and
2.1: Demonstrate an ability to identify and
parameters of computer based system to solve the
characterize an engineering problem
problems

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

Course Code: 24ECSF103 Course Title: Data Structures


L-T-P: 3-0-0 Credits: 3 Contact Hours: 3hrs/week
ISA Marks: 50 ESA Marks: 50 Total Marks: 100
Teaching Hrs:40 Exam Duration: 3 hrs.

Sl.No Content Hours


Unit-I
Chapter No. 1 Introduction to Data Structures
1 Review of C: Structures, Pointers, Dynamic Memory Allocation, Introduction to Data 06
Structures
Chapter No 2: Lists
Concept of lists: Definition, Representation of linked lists in Memory, Variants of Lists: 10
2
Singly Linked List, Doubly Linked lists, Circular linked lists.
Operations: Traversing, Searching, Insertion and Deletion. Applications of Linked lists
Unit-II
Chapter No. 3: Stacks and Recursion
Stack: Definitions and Examples, Representing Stacks in C, Applications: Infix to 08
3
postfix conversion, evaluation of postfix expression, parenthesis matching. Linked
Implementation of Stacks, Recursion
Chapter No. 4: Queues
08
4 Queue: Definitions, Representing Queues in C Variants of Queues: Linear queue,
circular queue, Applications of queue, Linked Implementation of Queues
Unit-III
Chapter No. 5: Graphs
Graphs: Definitions and examples of graph, Sub graphs, Components, Graph
5 04
Isomorphism, Vertex Degree, Euler Trails and Circuits, Planar Graphs, Hamilton
Paths and Cycles, Graph Coloring and Chromatic Polynomials.
Chapter No. 6: Trees
Definitions, Properties, examples, Rooted trees and Binary rooted trees, preorder and
6 04
postorder traversals, sorting, spanning trees, prefix codes and weighted trees,
Optimization and Matching

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

In-Semester Assessment Scheme

Assessment Weightage in Marks


ISA-1 20
ISA-2 20
Quiz on Unit-III 10
Total 50

Course Unitization for ISA and ESA

No. of No. of No. of No. of


Topics / Teaching
Questions in Questions Questions Questions in
Chapters Credits
ISA-1 in ISA-2 in Quiz ESA
Unit I
Chapter No. 1 06 1 - - 1
Chapter No. 2 10 2 - - 2
Unit II
Chapter No. 3 08 - 1.5 - 1.5
Chapter No. 4 08 - 1.5 - 1.5
Unit III
Chapter No.5 04 - - 1 1
Chapter No.6 04 - - 1 1

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.

Date: Head, CSE

Page 5 of 29
School of Computer Science & Engineering

Course Assessment Plan

Title: Data Structures Course Code :24ECSF103


Weightage in assessment

Course outcomes (COs) ISA


Weightage in ESA
ISA-1 ISA-2 Quiz
assessment
1. Explain the fundamental concepts of
linear and non-linear data structures. 30%    

2. Demonstrate properties, operations


and applications of various data    
structures. 35%

3. Apply appropriate data structures to


develop a solution for a given problem. 35%   -- 

Weightage 20% 20% 10% 50%

Page 6 of 29
School of Computer Science & Engineering

Chapter - wise Plan


Course Code and Title: Data Structures(24ECSF103)
Chapter Number and Title: 1. Introduction to Data Structures Planned Hours: 06hrs

Learning Outcomes: -
At the end of the topic the student should be able to:

Topic Learning Outcomes COs BL CA Code


1. Show the usage of structures in constructing user defined data types 1 L2 1.4
2. Apply pointers in different programming scenarios, including arrays, 3 L3 1.4
functions and dynamic memory allocation.
3. Explain structures with its operations 2 L2 1.4
4. Implement real-world applications using structures 3 L3 1.4

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

8. The X and Y coordinates of N different points are entered through 4 L2 1.4.1


the keyboard. Write a modular C program using pointers to find the
distance of last point from the first point.
9. Create two structures named Metric and British which store the 4 L3 1.4.1
values of distances. The Metric structure stores the values in
meters and centimeters and the British structure stores the values
in feet and inches. Write a modular C program that reads values
for the structure variables and adds values contained in one
variable of Metric to the contents of another variable of British.
The program should display the result in the format of feet and
inches or meters and centimeters as required.
10. Rewrite the program using Dynamic Memory allocation 2 L2 1.4.1

#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

Course Code and Title: Data Structures (24ECSF103)


Chapter Number and Title: 2.Lists Planned Hours: 10hrs

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

3. List the advantages and limitations of various linked lists. 1 L2 1.4

4. Develop programs to perform insertion, deletion, and traversal in 2 L3 1.4


singly, doubly, and circular linked lists.
5. Analyze real-world scenarios to select the suitable linked list type 3 L3 1.4
to develop efficient solutions.

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

Sl.No. - Questions TLOs BL PI Code


1. Explain memory mapping of linked list with neat diagram. 1 L2 1.4.1

2. Compare linked list with arrays? 2 L2 1.4.1

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.

8. Write a C program to implement a Doubly 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. Delete Nodes with Greater Values on Right
iv. Delete the first occurrence of a given key.

9. Develop a system to handle conference room reservations in an office 5 L3 2.1.2


building. The system should maintain a dynamically linked list of all
bookings, ensuring new reservations are stored in chronological order
to prevent scheduling conflicts. Each booking should include details
such as booking ID, room number, employee name, meeting time,
and duration. The system should support key operations like adding a
new reservation, modifying an existing one, canceling a booking, and
displaying all current reservations. Implement this system in C using a
doubly linked list for efficient management and updates.
10. Write a C program to implement a Circular Doubly linked list with 4 L2 1.4.1
the following functions:
i. Insert a new node at the beginning of the list.
ii. Delete all occurrences of a given key.

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

Course Code and Title: Data Structures (24ECSF103)


Chapter Number and Title: 3.Stacks and Recursion Planned Hours: 8hrs

Learning Outcomes:-
At the end of the topic the student should be able to:

Topic Learning Outcomes COs BL CA Code


1. Explain fundamental concepts of stacks. 1 L2 1.4
2. Demonstrate PUSH (), POP () and PEEK () operations of stack data
2 L3 1.4
structures.
3. Apply stacks to develop a solution for a given problem. 3 L3 1.4

4. Demonstrate the use of stacks to convert a given infix expression to 3 L3 1.4


postfix expression.
5. Demonstrate the use of stacks to evaluate a given postfix 3 L3 1.4
expression.
6. Demonstrate the application of stack in recursion. 3 L3 1.4

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

Sl.No. – Questions TLOs BL PI Code


1. What is stack? Explain why stack is called as LIFO data structure? 1 L2 1.4.1
2. Convert the following infix expression to its postfix form using stack 2 L3 1.4.1
A + (B – C)*D/E + F
Show the content of stack diagrammatically after each step of
conversion.

Page 12 of 29
School of Computer Science & Engineering

3. Consider an empty stack. Perform the following sequence of 1 L2 1.4.1


operations and show the content of the stack after each operation:

 push(5)
 push(10)
 push(15)
 pop()
 push(20)
 pop()
 push(25)

4. Check whether the following string contains balanced parentheses 2 L3 1.4.1


using a stack. Show the content of the stack after each step.

 "(())"
 "(())()"
 "(())("
 "(()"

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

9. Explain how recursion uses stacks by taking an example. 6 L2 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

Write a modular C program to display the remaining employees after


Y numbers of employees are fired.
[Note: For each candidate/employee, the details stored are: name,
Address, CGPA]

Input Format

 First line indicates M; initial number of employees present in the


company.
 Next M lines indicate details of the all the employees.
 Next line indicates N, the number of candidates sent resume
 Next N lines indicates Candidate details
 Next line indicates Y, the number of employees to be fired.

Constraints

 M>0
 N>=0
 Y>=0
 CGPA>=7.00 and CGPA<=8.50

Output Format

 Details of candidates/employees left in company after Y


candidates/employees are fired/removed.
[Note: You have to use PUSH(),POP(), DISPLAY(), ISEMPTY(),
ISFULL(), PEEK() Wherever necessary]

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????

Don't get amazed there is a solution for it.

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.

Each container has a name (like A, B, C etc.) and a unique ID


(integer). We are simulating the same for N containers.
For example, if number of containers is 3 then the following
sequence of keeping and closing will be valid.

Keeping sequence: C 3 B 2 A1 [Note: here C and 3 are the name


and unique ID respectively, of the biggest container]
Closing sequence: A 1 B 2 C 3

If number of containers are 7 then the following sequence of keeping


and closing will be valid.

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

if number of containers are 3 then the following sequence of keeping


and closing will be invalid

Keeping sequence: C 3 B 2 A1
Closing sequence: B 2 A 1 C 3

if number of containers are 7 then the following sequence of keeping


and closing will be valid.

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

Apply PSF to solve the problem using Stack


[Note: You have to use PUSH(),POP(), DISPLAY(), ISEMPTY(),
ISFULL(), PEEK() Wherever necessary]

Input Format

 First line contains N, which is number of containers


 Second line contains N container information (name and ID of
the container), which is sequence of containers opened and kept one
inside another.
 Third line contains N space separated values, which are
sequence of containers closed.

Constraint

 N should be between 1 to 9

Output Format

 Valid/ Invalid/ Invalid containers

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

Course Code and Title: Data Structures (24ECSF103)


Chapter Number and Title: 4.Queues Planned Hours: 08hrs

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?

4. Ram, a technical engineer at a call centre, is assigned the task of 3 L3 1.4.1


processing incoming call requests efficiently. To achieve this, he
designs a linear queue that follows the First-Come, First-Served
principle, ensuring that call requests are handled in the order they
arrive. The incoming request IDs are stored in a queue and
processed sequentially by removing them one by one. Once
processed, each request is displayed as a "Processed Call
Request."Write a modular C program to implement the scenario.

Page 17 of 29
School of Computer Science & Engineering

5. During lunch hours at a government school, food is distributed to 4 L3 2.1.2


students standing in a line. The distribution follows a First-Come,
First-Served approach, where students at the front receive food first.
However, there are exception:

If a class leader, teacher, or headmaster arrives, they are given


priority over regular students.

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

Course Code and Title: Data Structures (24ECSF103)


Chapter Number and Title: 5. Graphs Planned Hours: 4hrs

Learning Outcomes:-
At the end of the topic the student should be able to:

Topic Learning Outcomes Cos BL CA Code


1. Define the properties of graphs. 1 L2 1.3
2. Explain different types of graphs. 1 L2 1.3
3. Identify isomorphism and planarity. 2 L3 1.3
4. Identity and obtain Euler, Hamilton graphs. 3 L3 1.3
5. Define and obtain chromatic number and chromatic polynomial. 4 L3 1.3

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

2. Define a subgraph. Explain its types with suitable examples. 2 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

6. Explain the concept of graph coloring and its applications in 4 L3 1.1.1


scheduling problems.

7. Define chromatic polynomials. How do they help in determining 4 L3 1.1.1


graph colorability?

Page 19 of 29
School of Computer Science & Engineering

Course Code and Title: Data Structures (24ECSF103)


Chapter Number and Title: 6. Trees Planned Hours: 4hrs

Learning Outcomes: -
At the end of the topic the student should be able to:

Topic Learning Outcomes Cos BL CA Code


1. Explain the fundamental concepts of trees. 1 L2 1.1
2. Explain different types of tree traversals. 2 L2 1.4
3. Apply tree structures for sorting. 3 L3 1.4
4. Construct spanning tree for a given graph. 3 L3 1.1

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

3. Explain preorder, in order, and postorder traversal in a binary tree 2 L2 1.4.1


with examples.
4. Construct a tree given its in-order and pre-order traversal strings 2 L3 1.4.1
In-order: 1 2 34 5 6 78 910
pre-order: 6 4 2 1 3 5 87 910
5. Given a set of 8 vertices, how many different spanning trees can be 4 L3 1.1.1
formed from a complete graph of these vertices?
6. A company’s hierarchical structure follows a tree structure. If the 1 L3 1.1.1
CEO is the root, and each manager has at most 3 subordinates,
what is the minimum and maximum number of employees (nodes) in
a tree of height 3?
7. In a file system hierarchy, folders form a tree structure. If a root 1 L3 1.1.1
directory has 4 subdirectories, and each subdirectory can have at
most 3 files, what is the total number of files if the tree has 3 levels?

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

Note: Answer any two full questions (Question 1 is compulsory)

Q.N Questions Marks CO BL PO PI


o Code
1a. Differentiate between arrays and linked list. 04 1 L2 1 1.4.1

i. Define a structure to store the data of 1000 customers in 08 2 L2 1 1.4.1


1b. Canara Bank and compute the total memory allocated for the
structure.
ii. Write a user defined function to insert a new node at a
specified position in singly linked list(SLL).

Simran is passionate about collecting smart wristwatches and keeps 08 3 L3 2 2.1.2


1c. track of their details in a list. The list is organized so that she can view
the details of all watches in a single direction, forming a cycle where
after the last watch, the list loops back to the first one. Simran wants a
system that allows her to perform two operations: adding a new watch
to her collection after a particular brand and displaying the complete
list of watches. Define a structure for the watch details and write user-
defined functions using appropriate linked list to perform these
operations.

2a. Explain the following dynamic memory allocation functions in brief. 04 1 L2 1 1.4.1

i) malloc() ii) calloc()

2b. Write a user defined functions for the following: 08 2 L2 1 1.4.1

i. To count number of even nodes in singly linked list(SLL).


ii. To insert a new node at the end of the list in circular doubly
linked list(CDLL).

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.

3a Define a structure to store details of 7th semester students with 04 1 L2 2 2.1.2


minimum 4 attributes who got PLACEMENT OFFERS by a company.
Draw the memory mapping and compute the total memory required to
store 5 students information.

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:

i. To delete the node from specified position in circular singly


linked list(CSLL).
ii. To display the contents of list in reverse order in doubly linked
list(DLL).

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

Model Question Paper for In-Semester Assessment-2 (ISA-2)


Course: Data Structures Semester: II
Course Code:24ECSF103 Duration: 75 mins
Date of Exam: Divisions: A-F
Note: Answer any two full questions (Question 1 is compulsory)

Q.N Questions Marks CO BL PO PI


o Code
1a Which data structure is called as LIFO data structures and why? 04 1 L2 1 1.4.1

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.

Name of the customer


Gender of the customer
Coupon number
WINS CAR(if won car)/WINS BIKE(if won bike)

Write a C program to display the details of the customers who won the
prize.

2a What is a queue, and how does it differ from a stack? 04 1 L2 1 1.4.1


2b Convert the following infix expression to its postfix form using stack. 08 2 L3 1 1.4.1
a+b*c+d/(e+f*g)
Show the content of stack diagrammatically after each step conversion

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

Model Question Paper for End Semester Assessment (ESA)


Course Code: 24ECSF103 Course Title: Data Structures
Duration: 3 Hrs
Max. Marks: 100
Note:
i. Answer any five questions selecting 2 questions from UNIT-1 and UNIT-2 and 1 question
from UNIT-3.
ii. Each question carries equal marks.
UNIT I
Q.No Questions Marks CO BL PO PI Code
1a Define a structure to store details of 100 patients 04 1 L2 2 2.1.2
admitted to KLE Hospital with at least four attributes.
Calculate and display the total memory required to
store the data of all 100 patients.

1b i. How do arrays and linked lists vary in 08 L2 L2 1 1.4.1


memory allocation and data manipulation?
ii. Write a user defined function to delete a
node at a specified position in singly linked
list(SLL).

1c Design a program to simulate the functioning of a 08 L3 L3 2 2.1.2


traffic signal system at an intersection. The system
should follow a repeating sequence of traffic lights in
the order of Red, Green, and Yellow. Each light
should be displayed in the output for a certain
number of cycles, repeating the sequence
continuously. Implement the required operations to
create the traffic signal sequence and traverse
through it multiple times to simulate the continuous
change of lights. Calculate and display each traffic
light in sequence for the specified number of cycles.
Write user-defined functions using appropriate linked
list to perform these operations.

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

2b Write a user defined functions for the following: 08 L2 L2 1 1.4.1

i. To count number of odd nodes in singly


linked list(SLL).
ii. To insert a new node at the beginning of the
list in circular doubly linked list(CDLL).

2c Design and implement a system to manage 08 L3 L3 2 2.1.2


employee records for a company. The system should
support operations to add new employee records at

Page 26 of 29
School of Computer Science & Engineering

the end of the list and remove existing employee


records based on a unique identifier. Define a
structure to represent each employee record and
implement user-defined functions using appropriate
linked list to perform the operations.

3.a Define a structure to store the details of customers 04 L1 L2 2 2.1.2


who have won a lucky draw contest organized by a
shop owner. The structure should contain a minimum
of four attributes. Draw the memory mapping and
calculate the total memory required to store the
details of five customers.

3.b Write a user defined functions for the following: 08 L2 L2 1 1.4.1

i. To delete the node from the beginning of the


list in circular singly linked list(CSLL).
ii. Search for a specific element in a doubly
linked (DLL).

3.c "Rahul, a manager in a company, requires an 08 L3 L3 2 2.1.2


application to manage a video streaming playlist
efficiently. The system should enable users to
navigate seamlessly through a collection of videos by
supporting operations such as playing the next or
previous video, automatically looping back to the first
video after reaching the last. Additionally, the
application should allow users to add videos after a
specific video in the playlist and remove videos that
are no longer needed, ensuring the playlist is always
updated and easy to manage." Define a structure to
represent each video record and implement user-
defined functions using appropriate linked list to
perform the operations

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.

4.b A theme park is organizing a lucky draw event 08 2 L3 1 2.1.2


where visitors stand in a queue to participate.
However, due to time constraints, the park
management decides to remove every alternate
person from the queue. Write a user defined
function for the above task.

4.c Ram is working in a Solve soft software company. 08 3 L3 2 2.1.2


His manager informed him to design a new delimiter
checking code, i.e. parsing the given program that
involves analyzing a source program syntactically.
When the compiler translates a source program
written in some programming language such as C or
C++ to a machine language, it parses the program

Page 27 of 29
School of Computer Science & Engineering

into multiple individual parts, such as variable


names, keywords, etc., by scanning from left to right.
The problem encountered while translating is the
unmatched delimiters. We make use of different
types of delimiters, including the parenthesis
checking ( ), curly braces { } and square brackets [ ]
and common delimiters /* and */. Every opening
delimiter must match a closing delimiter, i.e., a
matching closing parenthesis should follow every
opening parenthesis. Also, the delimiter can be
nested. The opening delimiter that occurs later in the
source program should be closed before those
occurring earlier. Write a C program to perform the
delimiter checking.

5.a Write the steps involved in conversion of an infix 04 1 L2 1 1.4.1


expression to postfix expression using stack.

5.b Write a C program to demonstrate the PUSH( ), 08 2 L3 1 1.4.1


POP( ) and PEEK( ) operations of stack.

5.c A popular multiplex is screening the final show of a 08 3 L3 1 2.1.2


blockbuster movie. Due to a high demand, a long
queue of moviegoers has formed outside the ticket
counter. The ticket sales follow the standard FIFO
(First In, First Out) order, where the person who
arrives first gets served first. However, due to an
unexpected system error, the theater's management
decides to reverse the order of ticket distribution to
compensate for a mistake in previous bookings. This
means that the last person in the queue will now be
served first, making it a LIFO (Last In, First Out)
process. Write a modular C program to solve the
above problem.
6.a Compare linear queue and circular queue. 04 1 L2 1 1.4.1

6.b List the applications of stack. Explain any two 08 1 L2 1 1.4.1


applications of stack in brief by taking appropriate
example.

6.c Alice is using her computer to type a document in a 08 3 L3 1 2.1.2


word processor. While typing quickly, she notices
that even though she presses multiple keys rapidly,
the letters appear on the screen with a slight delay
but in the correct order. She is curious about how her
keystrokes are processed before being displayed on
the screen. A technician explains that the keyboard
uses a FIFO (First-In-First-Out) buffer to temporarily
store keystrokes before they are sent to the CPU for
processing. After understanding this she wanted to
design a application to handle keystroke processing,
ensuring that no keystrokes are lost even during
high-speed typing.

Page 28 of 29
School of Computer Science & Engineering

UNIT - III
Q.No. Questions Marks CO BL PO PI
Code

7a Explain the difference between Eulerian and 04 2 L2 1 1.1.1


Hamiltonian paths with examples.
7b Define a subgraph, how many sub graphs with at 08 2 L3 1 1.1.1
least one vertex does the following graphs have

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.

8b Construct Binary Search Tree for the following 08 2 L3 1 1.4.1


sequence of nodes and write its inorder, preorder
and postorder traversals.
40, 20, 60, 10, 30, 50, 70
8c Given a complete graph of 8 vertices. Draw and 08 1 L3 1 1.1.1
count how many different spanning trees can be
formed

Page 29 of 29

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy