0% found this document useful (0 votes)
6 views102 pages

Lesson Plan Data Structure Final

The document outlines a comprehensive lesson plan on data structures, covering topics such as one-dimensional and two-dimensional arrays, sparse matrices, and implementation concepts in programming. It includes objectives, outcomes, teaching methods, assessment strategies, and follow-up work for both slow and advanced learners. The plan emphasizes practical applications, coding practices, and the importance of efficient data management.

Uploaded by

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

Lesson Plan Data Structure Final

The document outlines a comprehensive lesson plan on data structures, covering topics such as one-dimensional and two-dimensional arrays, sparse matrices, and implementation concepts in programming. It includes objectives, outcomes, teaching methods, assessment strategies, and follow-up work for both slow and advanced learners. The plan emphasizes practical applications, coding practices, and the importance of efficient data management.

Uploaded by

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

Lesson Plan – Introduction to Data Structures

Section Details
- Understand the concept and need for data structures. - Identify basic types
Lesson Objectives of data structures. - Recognize how data structures organize and manage data
efficiently. - Relate data structure choice to problem-solving strategies.
✔ Define what a data structure is. ✔ Name and describe linear and non-
linear data structures. ✔ Explain use cases for arrays, linked lists, stacks,
Lesson Outcomes queues, trees, and graphs. ✔ Differentiate between static and dynamic data
structures. ✔ Understand importance of data structures in algorithm
efficiency.
Methods of - Concept explanation using diagrams. - Real-world analogies and use-cases.
Pedagogy - Visual aids for structure layouts. - Group discussions and board examples.
- Slides with visual representations - Board for structure sketches - Turbo C /
Teaching Tools
Code::Blocks for basic demos - Concept chart for classification of structures
Motivation/ - Ask how we store a list of student names or process a queue of customers. -
Introducing the Show limitations of primitive data types. - Introduce data structures as tools
Topic (5 mins) to manage data efficiently.
1. Definition of Data Structures: Ways of organizing and storing data. 2.
Classification: - Linear: Array, Linked List, Stack, Queue - Non-linear:
Tree, Graph 3. Operations on Data Structures: Insertion, deletion,
traversal, searching. 4. Arrays vs Linked Lists: Static vs dynamic memory.
Content
5. Stack and Queue: LIFO and FIFO behavior. 6. Tree and Graph (Intro):
Presentation (40
Hierarchical and network structures. 7. Applications: Scheduling (queue),
mins)
undo (stack), file system (tree), networks (graph). 8. Efficiency Factors:
Time and space complexity relevance. 9. Real-life Analogy: Stack of books,
customer line in bank, folders in file explorer. 10. Summary Chart:
Compare different structures side by side.
1. Which of the following is a linear data structure? D) None C) Stack B)
Graph A) Tree Answer: C 2. Which structure follows FIFO? D) Tree C)
Array B) Queue A) Stack Answer: B 3. Which is non-linear? D) Tree
Assessment (5
C) Linked List B) Array A) Queue Answer: D 4. Why use data
mins)
structures? D) Slow execution C) Efficient data handling B) To confuse
code A) For decoration Answer: C 5. Which is dynamic in nature? D)
Constant C) Static variable B) Linked List A) Array Answer: B
Summing up (5 - Recap key structures and classification. - Revisit use-cases and real-life
mins) analogies. - Highlight how structure choice affects performance.
For Slow Learners: - Provide visual match-the-structure worksheets. -
Follow-up Work Trace flow of insertion in array vs linked list. For Advanced Learners: -
(5 mins) Ask to simulate stack/queue using arrays. - Explore time complexity of
insertion/deletion for each structure.

Lesson Plan – Implementation Concepts


Section Details
- Understand what implementation means in the context of data structures
and algorithms. - Identify the key steps in implementing a data structure in C.
Lesson Objectives
- Recognize the difference between abstract concepts and their code-level
realization. - Learn how to convert logic into structured programs.
✔ Define implementation in programming. ✔ Identify key implementation
components: declaration, initialization, access, and manipulation. ✔
Lesson Outcomes
Implement basic data structures like arrays and linked lists. ✔ Translate
algorithmic steps into C code. ✔ Debug and validate implemented code.
Methods of - Code-driven explanation. - Flowcharts to algorithm walkthrough. - Live
Pedagogy implementation demos. - Peer code review activities.
- Turbo C / Code::Blocks - Visual Studio Code for structured coding -
Teaching Tools
Projector and board - Pseudocode to C translation exercises
Motivation/ - Ask how a real-world plan is turned into action (e.g., cooking recipe). -
Introducing the Link it to implementation of ideas in programming. - Show how knowing
Topic (5 mins) logic is different from building it into working code.
1. Definition of Implementation: Realization of an algorithm in a
programming language. 2. Steps in Implementation: - Plan logic - Write
pseudocode - Declare variables and structures - Use loops, conditions, and
functions - Compile and test 3. Example: Implement linear search from logic
Content to C code. 4. Implementation of a Linked List (basic insert & display). 5.
Presentation (40 Tools: Use of IDEs, compilers, debuggers. 6. Common Issues: Syntax
mins) errors, logic errors, runtime errors. 7. Tips for Clean Implementation:
Proper indentation, modular code, commenting. 8. Practice Activity:
Convert flowchart of stack push/pop into code. 9. Real-Life Analogy:
Designing a building (algorithm) vs constructing it (implementation). 10.
Summary: Difference between concept and code.
1. What does implementation mean in programming? D) Compiling C)
Writing code based on logic B) Designing flowcharts A) Writing
algorithms in English Answer: C 2. What is the first step in implementing
logic? D) Copying code C) Understanding the problem B) Writing
Assessment (5 output A) Typing code Answer: C 3. Which is used in implementation? D)
mins) All C) Pseudocode B) Flowchart A) Diagram Answer: D 4. What does
a successful implementation require? D) None C) Logic + Syntax B)
Compiler only A) Syntax only Answer: C 5. Which one best describes the
implementation of a stack? B) Inserting A) if-else statements & D) Copy-
paste code C) Drawing blocks removing from top Answer: B
- Recap implementation flow from logic to execution. - Highlight the key
Summing up (5
steps of translating ideas into programs. - Emphasize importance of clean and
mins)
error-free code.
For Slow Learners: - Provide templated examples to fill in missing logic. -
Follow-up Work Offer trace tables for each logic step. For Advanced Learners: - Challenge
(5 mins) with implementing queue and binary search. - Ask to debug incomplete or
faulty code.
Lesson Plan – One-Dimensional Arrays

Section Details
- Understand the concept of one-dimensional arrays. - Learn how to declare,
initialize, and access array elements. - Perform basic operations such as
Lesson Objectives
traversal, updating, and summing. - Explore memory representation and
limitations of arrays.
✔ Define a one-dimensional array. ✔ Declare and initialize arrays in C. ✔
Lesson Outcomes Access and modify array elements using index. ✔ Write programs that
manipulate array data. ✔ Understand indexing and array bounds.
- Code demonstration and explanation. - Memory diagram and dry-run
Methods of
practice. - Use of real-life examples (e.g., storing marks). - Interactive
Pedagogy
questioning and group work.
- Code::Blocks / Turbo C IDE - Whiteboard and array index charts -
Teaching Tools
Projector and laptop - Sample programs and trace tables
Motivation/ - Ask how students store multiple values (e.g., 5 subject marks). - Introduce
Introducing the arrays as a solution to manage collections of same-type data. - Link to
Topic (5 mins) practical examples like scores, prices, or temperatures.
1. Definition: Array is a collection of elements of the same type stored in
contiguous memory. 2. Declaration Syntax: int arr[5]; 3. Initialization:
- At declaration: int arr[3] = {10, 20, 30}; - Partial initialization fills
Content rest with zero. 4. Indexing: Starts from 0. Access via arr[0], arr[1], etc.
Presentation (40 5. Traversal: Using loops (for/while) to visit each element. 6. Updating:
mins) Assigning new value to specific index. 7. Summing & Aggregates:
Example program for total and average. 8. Out-of-bounds Error: Risk
when accessing beyond array size. 9. Real-Life Analogy: List of student
marks, prices of items. 10. Visual Demo: Array memory block sketch.
1. What is the index of the first element in an array? D) Depends C) -1 B)
0 A) 1 Answer: B 2. Which declaration is valid in C? D) None C) Both
A and B B) int arr[3] = {1,2,3}; A) int arr[] = {1,2,3}; Answer: C 3.
Assessment (5 How many elements are in int arr[5];? D) Undefined C) 6 B) 5 A)
mins) 4 Answer: B 4. Which loop is best suited for array traversal? D) goto C)
for B) while A) if Answer: C 5. What happens if arr[10] is accessed
when size is 5? D) Stops program C) Output 0 B) Undefined A) Error
Answer: B
- Recap declaration, initialization, and access of one-dimensional arrays. -
Summing up (5
Emphasize index rules and looping for traversal. - Reiterate common
mins)
mistakes and best practices.
For Slow Learners: - Provide fill-in-the-blanks for declaration and access. -
Follow-up Work Use flowcharts to visualize traversal logic. For Advanced Learners: -
(5 mins) Implement max/min finder in an array. - Solve reverse array and element
search problems.
Lesson Plan – Two-Dimensional Arrays

Section Details
- Understand the concept of two-dimensional arrays. - Learn how to declare,
Lesson Objectives initialize, and access elements in 2D arrays. - Perform operations such as
traversal and updating values. - Visualize 2D arrays as tables or matrices.
✔ Define a two-dimensional array. ✔ Declare and initialize 2D arrays in C.
✔ Access and modify elements using row and column indices. ✔ Write
Lesson Outcomes
programs that perform operations on 2D arrays. ✔ Understand memory
structure and row-major order.
- Code demonstration with nested loops. - Matrix drawing on board for
Methods of
concept clarity. - Dry-run practice of accessing and modifying elements. -
Pedagogy
Group-based problem-solving exercises.
- Code::Blocks / Turbo C IDE - Projector and laptop - Grid charts for row-
Teaching Tools
column representation - Sample matrix-based problems
Motivation/ - Ask how students would store a table of marks (e.g., 3 students, 4 subjects).
Introducing the - Show limitation of 1D arrays and introduce 2D arrays for tabular data. -
Topic (5 mins) Real-world examples: seating charts, multiplication tables.
1. Definition: Array with rows and columns storing homogeneous data. 2.
Declaration Syntax: int arr[3][4]; (3 rows, 4 columns). 3.
Initialization: - Static: int arr[2][2] = {{1,2}, {3,4}}; - Partial: fills
Content remaining values with 0. 4. Indexing: arr[i][j] where i is row, j is column
Presentation (40 (starts from 0). 5. Traversal: Nested loops to access all elements. 6.
mins) Updating: Assigning new values to specified positions. 7. Summing
Rows/Columns: Write program to calculate totals. 8. Memory Structure:
Stored in row-major order in C. 9. Analogy: Spreadsheet rows and columns.
10. Visual Demo: Grid layout of array with values.
1. What is the correct way to declare a 2D array in C? D) array int[3][4]; C)
int[3,4] arr; B) int arr[3][4]; A) int arr(3,4); Answer: B 2. How is a 2D
array indexed? D) arr(i,j) C) arr[i.j] B) arr[i][j] A) arr[i,j] Answer: B 3.
Which loop type is best for 2D array traversal? D) while only C) Nested for
Assessment (5
loop B) if A) Single for loop Answer: C 4. What is the output of arr[1]
mins)
[1] in int arr[2][2] = {{5,6},{7,8}};? D) 5 C) 8 B) 7 A) 6
Answer: C 5. What happens if arr[3][3] is accessed in an array of size [2]
[2]? D) Skips it C) Undefined behavior B) Compile error A) Returns 0
Answer: C
Summing up (5 - Recap declaration and structure of 2D arrays. - Revisit indexing and nested
mins) loop usage. - Emphasize practical applications and error prevention.
For Slow Learners: - Fill-in-the-grid worksheets. - Practice simple access
Follow-up Work
and update operations. For Advanced Learners: - Create programs to
(5 mins)
perform row/column-wise operations. - Implement transpose of a 2D array.

Lesson Plan – Sparse Matrices in Data Structures


Section Details
- Understand the concept and need for sparse matrices. - Identify
characteristics of sparse vs. dense matrices. - Learn representation
Lesson Objectives
techniques: array of structures, coordinate list, and compressed storage. -
Write simple programs to represent and manipulate sparse matrices.
✔ Define a sparse matrix and its significance. ✔ Identify scenarios where
sparse matrices are beneficial. ✔ Implement sparse matrix representation in
Lesson Outcomes
C using arrays. ✔ Perform basic operations like transpose and addition on
sparse matrices. ✔ Compare memory usage of sparse and normal matrices.
- Real-life analogies (e.g., bus seat layout with few passengers). - Code
Methods of
walkthrough of sparse matrix conversion. - Tabular comparison of normal vs.
Pedagogy
sparse representation. - Board demonstrations and trace tables.
- Code::Blocks / Turbo C - Projector and laptop - Worksheets with matrix
Teaching Tools
examples - Sparse matrix diagram charts
Motivation/ - Ask: What if most elements in a matrix are zero? - Discuss memory
Introducing the inefficiency in such cases. - Introduce sparse matrices as an optimized
Topic (5 mins) solution.
1. Definition: Sparse matrix is a matrix with majority of zero elements. 2.
Example: 5x5 matrix with only 3 non-zero values. 3. Representations: -
Coordinate list (row, col, value) - Array of structures - 3-column compact
matrix 4. Advantages: Saves space and speeds up processing. 5. Conversion
Content
Algorithm: From 2D to sparse representation. 6. Basic Operations:
Presentation (40
Display, search, and transpose. 7. Application Areas: Image processing,
mins)
graphs, storage systems. 8. Code Example: C program to convert and print
sparse matrix. 9. Common Mistakes: Incorrect indexing, misinterpretation
of row/col format. 10. Visual Demo: Step-by-step dry run of sparse
conversion.
1. What defines a sparse matrix? D) Diagonal matrix C) Mostly zero
elements B) All elements non-zero A) All elements zero Answer: C 2.
Which is not a valid sparse matrix representation? D) Triplet array C)
Coordinate format B) Matrix chain A) Array of structures Answer: B 3.
Assessment (5 Which operation is optimized in sparse matrices? D) Space usage C)
mins) Multiplication B) Transpose A) Access Answer: D 4. What is the main
drawback of normal matrix for sparse data? D) Hard syntax C) Wasted
memory B) More lines of code A) Extra time Answer: C 5. How is a
sparse matrix stored in 3-column form? D) row only C) col, row, value
B) value, row, col A) row, col, value Answer: A
- Recap the need and use of sparse matrices. - Reinforce representation
Summing up (5
techniques and coding strategy. - Emphasize memory advantage and
mins)
applications.
For Slow Learners: - Match sparse matrix representation exercises. -
Follow-up Work Practice dry-run on fixed matrix samples. For Advanced Learners: -
(5 mins) Implement sparse matrix addition or transpose in C. - Compare time and
space of normal vs sparse matrix.
Lesson Plan – Higher-Dimensional Arrays

Section Details
- Understand the concept of higher-dimensional arrays (3D and above). -
Learn how to declare, initialize, and access elements in higher-dimensional
Lesson Objectives
arrays. - Visualize the structure and organization of 3D arrays. - Explore
basic use-cases and implementation techniques.
✔ Define higher-dimensional arrays and their purpose. ✔ Declare and
initialize 3D arrays in C. ✔ Access elements using multiple indices. ✔
Lesson Outcomes
Understand row-major memory layout for multidimensional arrays. ✔ Write
basic programs using 3D arrays.
- Visual diagrams and layered grids for 3D representation. - Code
Methods of
demonstration and tracing. - Group discussion on memory mapping. - Real-
Pedagogy
world analogies and use-case matching.
- Code::Blocks / Turbo C - Projector and laptop - 3D block diagrams -
Teaching Tools
Sample programs and memory maps
Motivation/ - Ask students how they would store a series of matrices (e.g., multiple
Introducing the images, multi-sensor data). - Explain limitations of 2D arrays. - Introduce 3D
Topic (5 mins) arrays as arrays of 2D arrays.
1. Definition: Arrays with more than two dimensions. 2. Declaration
Syntax: int arr[2][3][4]; 3. Initialization: Static and partial using
nested braces. 4. Indexing: arr[i][j][k] for 3D (layer, row, column). 5.
Content Traversal: Use of three nested loops. 6. Visual Structure: 3D cube layout
Presentation (40 explained. 7. Applications: Image processing (color channels), simulation
mins) data, medical imaging. 8. Program Example: Declare and display elements
of a 3D array. 9. Common Issues: Off-by-one indexing, visualization
confusion, memory consumption. 10. Comparison: Differences in use and
structure between 2D and 3D arrays.
1. What is a higher-dimensional array? D) Undefined array C) Array with
3+ dimensions B) 2D array A) 1D array Answer: C 2. How many indices
are required for accessing a 3D array? D) 4 C) 3 B) 2 A) 1 Answer: C
3. What is the structure of int arr[2][2][2];? D) Matrix chain C) 4
Assessment (5
blocks B) 2 matrices each 2x2 A) 2 rows only Answer: B 4. Which of
mins)
these represents a 3D array access? D) arr(i,j,k) C) arr[i][j][k] B) arr[i]
[j] A) arr[i] Answer: C 5. Which of the following is a use of 3D arrays? D)
File creation C) Image representation B) Graph plotting A) Sorting
Answer: C
- Recap declaration, indexing, and purpose of higher-dimensional arrays. -
Summing up (5
Reinforce memory structure and access patterns. - Highlight practical
mins)
application areas.
Follow-up Work For Slow Learners: - Practice labeling elements with correct indices. -
(5 mins) Trace access in simple 3D arrays. For Advanced Learners: - Write
programs for sum/average across layers. - Simulate RGB image storage with
3D arrays.

Lesson Plan – Array Review & Practice

Section Details
- Review concepts of one-dimensional, two-dimensional, and higher-
dimensional arrays. - Reinforce understanding of declaration, initialization,
Lesson Objectives
and access methods. - Practice solving problems using arrays. - Develop
logical thinking using array-based programs.
✔ Recall array declaration and initialization across dimensions. ✔ Use
correct syntax for accessing array elements. ✔ Apply knowledge of arrays in
Lesson Outcomes
solving practical problems. ✔ Debug common array-related errors. ✔
Demonstrate confidence in using arrays in C programming.
Methods of - Quick recap slides for each array type. - Live problem-solving sessions. -
Pedagogy Peer code reviews and interactive Q&A. - Timed coding challenges.
- Turbo C / Code::Blocks - Projector and laptop - Array problem sheets -
Teaching Tools
Visual memory maps for debugging support
Motivation/ - Ask students where they have seen arrays used in earlier programs. -
Introducing the Emphasize that review and practice are key to mastering arrays. - Present
Topic (5 mins) real-world scenarios where arrays are essential.
1. Recap of Array Types: 1D, 2D, and 3D arrays. 2. Syntax Review:
Declaration, initialization, access, and traversal. 3. Example Review
Problems: - Reverse an array - Find max/min element - Matrix addition -
Count positive/negative values in a 3D array 4. Debugging Practice:
Content
Identify and fix bugs in array code snippets. 5. Group Challenge: Design a
Presentation (40
program using a combination of arrays. 6. Output Tracing: Manually trace
mins)
array loops for given inputs. 7. Real-Life Problems: Seating charts, marks
calculation, RGB manipulation. 8. Best Practices: Use of constants for size,
loop bounds, error handling. 9. Quick Quiz: Spot the error questions. 10.
Summary of Key Concepts: Efficient indexing, memory structure.
1. Which index starts a 1D array in C? D) Depends C) -1 B) 0 A) 1
Answer: B 2. Which of these accesses a 2D array element? C) arr B) arr[i]
[j] A) arr(i,j)<i,j>D) arr.i.j Answer: B 3. What error occurs when
accessing out of bounds? D) Stack overflow C) Undefined behavior B)
Assessment (5
Syntax A) Compilation Answer: C 4. What does int arr[3][2][2];
mins)
represent? D) Invalid C) 2 rows of 3x2 B) 3 layers of 2x2 A) 3 rows
only Answer: B 5. What is the purpose of arrays? D) Print data C) Store
multiple same-type values B) Store character only A) Store single values
Answer: C
- Recap reviewed array topics and common pitfalls. - Reinforce importance
Summing up (5
of hands-on practice. - Motivate learners to explore more problems
mins)
independently.
For Slow Learners: - Provide guided worksheets for basic array operations.
Follow-up Work - Offer step-by-step logic breakdown for typical problems. For Advanced
(5 mins) Learners: - Assign open-ended challenges like array-based games. -
Integrate arrays with file operations or structures.

Lesson Plan – Introduction to Stacks

Section Details
- Understand the concept and structure of stack data structure. - Learn stack
Lesson Objectives operations: push, pop, peek/top. - Explore stack implementation using arrays.
- Identify real-world use cases of stacks.
✔ Define what a stack is and describe its LIFO behavior. ✔ Implement stack
operations in C using arrays. ✔ Use stack to solve real-world and algorithmic
Lesson Outcomes
problems. ✔ Debug and trace stack behavior during execution. ✔ Recognize
stack limitations (overflow/underflow).
- Chalk and talk using diagrams. - Live coding of stack push and pop
Methods of
operations. - Trace table practice for stack manipulation. - Interactive
Pedagogy
questioning and real-life comparisons.
- Turbo C / Code::Blocks - Projector and laptop - Stack structure diagrams
Teaching Tools
and memory visuals - Code snippets and trace worksheets
Motivation/ - Ask: How do we undo actions in a browser or editor? - Introduce stack as a
Introducing the last-in-first-out (LIFO) structure. - Present a real-life example: stack of
Topic (5 mins) plates/books.
1. Definition: A linear data structure following LIFO principle. 2. Basic
Operations: - Push (insert) - Pop (remove) - Peek (view top) 3.
Implementation Using Arrays: Define array and top pointer. 4. Code
Demonstration: Program for push, pop, and peek. 5. Stack Overflow and
Content
Underflow: Explain when top exceeds capacity or is below zero. 6. Use
Presentation (40
Cases: - Undo mechanisms - Expression evaluation - Recursion support 7.
mins)
Visual Demo: Stack behavior shown with values and memory state. 8. Dry
Run: Walkthrough of stack code for sample inputs. 9. Common Errors: Not
updating top, accessing empty stack. 10. Summary Table: Stack operations
and corresponding code snippet.
1. What does a stack follow? D) Random C) FILO B) LIFO A) FIFO
Answer: B 2. Which operation removes the top element? D) Insert C)
Pop B) Push A) Peek Answer: C 3. What causes stack overflow? D)
Assessment (5 All C) Viewing top B) Popping from empty stack A) Pushing into full
mins) stack Answer: A 4. Which function gives the last inserted value without
removing it? D) Display C) Push B) Peek A) Pop Answer: B 5. Which
of these is a valid stack application? D) File I/O C) Sorting B) Undo
feature A) Searching Answer: B
- Recap LIFO concept, key operations, and implementation. - Emphasize
Summing up (5
practical stack applications. - Highlight error conditions like
mins)
overflow/underflow.
For Slow Learners: - Step-by-step push/pop examples with dry runs. -
Follow-up Work Provide stack tracing worksheets. For Advanced Learners: - Implement
(5 mins) infix to postfix conversion using stacks. - Integrate stack operations into
larger applications like parsers.

Lesson Plan – Stack Operations

Section Details
- Understand core stack operations in depth. - Implement stack operations:
push, pop, peek, isEmpty, isFull. - Handle stack overflow and underflow
Lesson Objectives
conditions programmatically. - Strengthen logic and structure of stack-based
coding.
✔ Write functions for push, pop, and peek operations in C. ✔ Use conditions
to check stack overflow/underflow. ✔ Debug stack programs effectively. ✔
Lesson Outcomes
Implement a stack using array structure with full operation set. ✔ Apply
stack operations in solving real-life programming tasks.
- Code breakdown and line-by-line explanation. - Diagram-based tracing of
Methods of
push/pop on board. - Peer code simulation of stack behavior. - Interactive
Pedagogy
quizzes on stack condition checks.
- Code::Blocks / Turbo C - Projector and laptop - Visual charts for top
Teaching Tools
movement - Worksheets with incomplete stack functions to fill
Motivation/ - Ask: What happens if you try to remove an item from an empty drawer? -
Introducing the Connect to pop operation and stack underflow. - Relate pushing beyond
Topic (5 mins) capacity to stack overflow scenario.
1. Stack Structure Recap: Array + top pointer. 2. Push Operation: Add
element at top, increment top. 3. Pop Operation: Remove element from top,
decrement top. 4. Peek Operation: View element at current top. 5. isFull &
Content isEmpty Functions: Check conditions to validate operation. 6. Code
Presentation (40 Demonstration: Implement stack with all major operations. 7. Use Case
mins) Practice: Menu-based stack program to accept user input. 8.
Overflow/Underflow Scenarios: Simulation and prevention strategies. 9.
Trace Table Activity: Manually trace changes to top with a sequence of
operations. 10. Summary Chart: Operations vs purpose vs condition checks.
1. What does pop() do in stack? D) Shows all values C) Swaps two
values B) Deletes from top A) Adds element Answer: B 2. When is the
stack full in array implementation? D) top C) top == 0 B) top == size -
1 A) top == -1 > size Answer: B 3. What value indicates stack is empty?
Assessment (5
D) top C) top == -1 B) top == 0 A) top == size > size Answer: C 4.
mins)
Which operation checks current top value without removing it? D) delete
C) peek B) pop A) push Answer: C 5. What prevents overflow in stack?
D) None C) Checking isFull before push B) Checking isEmpty A)
Resetting top Answer: C
Summing up (5 - Recap how each stack operation works. - Highlight stack status checks:
mins) isEmpty and isFull. - Emphasize code efficiency and error prevention.
For Slow Learners: - Provide push/pop sample problems to trace manually.
Follow-up Work - Offer template programs to complete. For Advanced Learners: -
(5 mins) Implement stack using linked list. - Solve prefix/postfix evaluation with stack
logic.

Lesson Plan – Applications: Arithmetic Expressions

Section Details
- Understand the role of stacks in evaluating arithmetic expressions. - Learn
infix, prefix, and postfix notations. - Implement algorithms for expression
Lesson Objectives
conversion and evaluation. - Solve real-life arithmetic problems using stack-
based techniques.
✔ Differentiate between infix, prefix, and postfix expressions. ✔ Convert
expressions using stack operations. ✔ Evaluate postfix expressions using
Lesson Outcomes
stacks in C. ✔ Trace stack behavior during conversion and evaluation. ✔
Solve problems related to arithmetic expression parsing.
- Visual explanation of notations and stack behavior. - Code demonstration
Methods of
and dry-run. - Expression tracing activities. - Practice worksheets for
Pedagogy
conversion and evaluation.
- Turbo C / Code::Blocks - Projector and laptop - Expression trees and
Teaching Tools
flowcharts - Manual tracing sheets with step-by-step stacks
Motivation/ - Ask how calculators evaluate complex expressions without parentheses. -
Introducing the Introduce notation forms and their benefits. - Show limitations of direct infix
Topic (5 mins) evaluation.
1. Expression Forms: - Infix: A + B - Prefix: + A B - Postfix: A B + 2.
Need for Conversion: Stacks simplify expression parsing and evaluation. 3.
Infix to Postfix Conversion: - Use precedence rules and stack to reorder. -
Algorithm explanation and example walkthrough. 4. Postfix Evaluation: -
Content Use a stack to store operands. - Process operators with top stack values. 5.
Presentation (40 Code Examples: - Infix to Postfix Conversion Program. - Postfix Evaluation
mins) Program. 6. Real-Life Relevance: Compilers, calculators, interpreters. 7.
Visual Demo: Trace steps of conversion and evaluation. 8. Error
Handling: Invalid expressions, stack underflow. 9. Summary Table:
Expression form vs usage. 10. Class Practice: Solve expressions with and
without parentheses.
1. What does postfix expression avoid? D) Values C) Parentheses B)
Operators A) Variables Answer: C 2. Which data structure is used for
expression evaluation? D) Array C) Stack B) Tree A) Queue Answer:
C 3. Which is the correct postfix for A + B * C? C) A+B B) AB+C* A)
Assessment (5
ABC*+D) +A CBC Answer: A 4. What is evaluated first in prefix? D)
mins)
Right operand C) Left operand B) Last operand A) First operator
Answer: A 5. What happens if stack is empty during pop in evaluation? D)
Output 0 C) Stack underflow B) Program stops A) Stack expands
Answer: C
Summing up (5 - Recap infix, prefix, postfix forms and stack usage. - Emphasize stack’s role
mins) in solving and evaluating expressions. - Reinforce key conversion rules.
For Slow Learners: - Solve simple 2-operand expressions for conversion
Follow-up Work and evaluation. - Use diagrams to visualize each stack step. For Advanced
(5 mins) Learners: - Implement full expression parser. - Add support for parentheses
and multi-digit numbers in evaluation.

Lesson Plan – Application: Infix to Postfix Conversion

Section Details
- Understand the limitations of infix notation in direct evaluation. - Learn the
conversion process from infix to postfix using a stack. - Implement the
Lesson Objectives
algorithm for infix to postfix conversion in C. - Apply conversion technique
to solve arithmetic problems effectively.
✔ Explain the need for converting infix expressions to postfix. ✔
Demonstrate infix to postfix conversion using stack operations. ✔ Write C
Lesson Outcomes
programs to perform the conversion. ✔ Trace conversion steps manually
with stack operations. ✔ Apply the concept in expression evaluation tasks.
- Concept demonstration with stack trace. - Code walkthrough and dry-run. -
Methods of
Comparative activity between infix and postfix forms. - Pair exercises for
Pedagogy
conversion practice.
- Turbo C / Code::Blocks - Projector and laptop - Whiteboard for precedence
Teaching Tools
rules and stack simulation - Sample problems and flowcharts
Motivation/ - Ask students: How does a calculator understand the order of operations? -
Introducing the Show limitations of direct infix parsing. - Introduce postfix as a parenthesis-
Topic (5 mins) free and unambiguous form.
1. Infix Notation Limitations: Parentheses and operator precedence
complexities. 2. Postfix Advantages: Eliminates ambiguity, easier to
evaluate with stack. 3. Algorithm Steps: - Scan expression left to right. -
Use stack to store operators. - Apply precedence and associativity rules. -
Content Append operands directly to result. - Pop operators from stack to result as
Presentation (40 needed. 4. Example: Convert (A+B)*C to AB+C*. 5. Operator Precedence
mins) Table: Visual chart for quick reference. 6. Code Example: Step-by-step C
implementation. 7. Dry-Run Demonstration: Stack behavior for complex
expressions. 8. Applications: Used in interpreters, compilers, expression
evaluators. 9. Error Cases: Unbalanced parentheses, invalid characters. 10.
Practice Problems: Class exercises for 3–5 expressions.
Assessment (5 1. What is the postfix of (A + B) * C? B) A+B A) AB+C*C) ABC+
mins) CD) +AB C Answer: A 2. Which structure is used in infix to postfix
conversion? D) Graph C) Tree B) Stack A) Queue Answer: B 3. What
happens when a ) is encountered during conversion? C) Pop till B) Push
to stack A) Skip it (D) Error Answer: C 4. Which comes first in
precedence? D) = C) * B) - A) + Answer: C 5. What is the postfix of A
+ B * C? A) AB+CD) A*BC+ C) A+BC* B) ABC*+ Answer: B
Summing up (5 - Recap conversion algorithm and stack role. - Reinforce precedence and
mins) associativity application. - Emphasize real-life usefulness of conversion.
For Slow Learners: - Provide guided steps and stack flow templates. - Use
Follow-up Work color-coded flowcharts for operator actions. For Advanced Learners: -
(5 mins) Extend conversion program to handle multi-digit and complex expressions. -
Integrate postfix evaluation after conversion.

Lesson Plan – Application: Postfix Evaluation

Section Details
- Understand the evaluation process of postfix expressions using a stack. -
Learn step-by-step execution for solving postfix expressions. - Implement the
Lesson Objectives
algorithm for postfix evaluation in C. - Apply the evaluation method in
expression-based problem solving.
✔ Explain the process of postfix expression evaluation. ✔ Trace evaluation
using a stack. ✔ Write C programs to evaluate postfix expressions. ✔ Handle
Lesson Outcomes
different operand types and operators. ✔ Apply postfix evaluation in
calculator-style applications.
- Stack-based tracing with manual examples. - Live coding and dry-run on
Methods of
examples. - Group activity solving postfix expressions. - Comparative
Pedagogy
discussion with infix evaluation.
- Turbo C / Code::Blocks - Projector and laptop - Whiteboard for stack
Teaching Tools
simulation - Step-by-step dry-run worksheets
Motivation/ - Ask: How does a postfix expression like 23+ evaluate without brackets? -
Introducing the Emphasize clarity and simplicity in postfix notation. - Connect to prior
Topic (5 mins) knowledge of stack use in infix to postfix conversion.
1. Postfix Format Recap: No need for brackets or precedence rules. 2.
Evaluation Algorithm: - Scan left to right. - Push operands on stack. - On
operator: pop top two, apply operator, push result. 3. Example: 23*54*+9-
→ step-by-step evaluation. 4. Stack Tracing: Visual step display on board.
Content
5. C Code Implementation: Program for evaluating postfix expressions. 6.
Presentation (40
Real-World Uses: Embedded calculators, compiler back-end. 7. Error
mins)
Handling: Stack underflow, invalid character input. 8. Evaluation of
Complex Expressions: Handle multi-digit and variables if extended. 9.
Comparison with Infix Evaluation: Less overhead, better performance. 10.
Practice Problems: Evaluate 4–5 expressions in class.
Assessment (5 1. What does postfix eliminate? D) Operands C) Operators B) Brackets
mins) A) Variables Answer: B 2. Which structure helps in postfix evaluation? D)
Graph C) Stack B) Queue A) Array Answer: C 3. What is the result of
postfix 23*? D) 3 C) 2 B) 6 A) 5 Answer: B 4. What causes stack
underflow? D) No error C) Full stack B) Operator without enough
operands A) Too many operands Answer: B 5. What is the first step in
postfix evaluation? D) Add brackets C) Scan left to right B) Read all
expression A) Pop and add Answer: C
- Recap steps and benefits of postfix evaluation. - Emphasize stack's role in
Summing up (5
operand storage and evaluation logic. - Review code flow and common
mins)
pitfalls.
For Slow Learners: - Provide visual stack flow activities. - Assign simple
Follow-up Work expressions to evaluate manually. For Advanced Learners: - Extend to
(5 mins) expressions with multi-digit operands. - Combine postfix evaluation with
conversion in a single program.

Lesson Plan – Application: Recursion

Section Details
- Understand recursion as a programming technique. - Explore the structure
Lesson Objectives and behavior of recursive function calls. - Learn to identify problems that can
be solved using recursion. - Implement and trace recursive functions in C.
✔ Define recursion and describe how it works. ✔ Write simple recursive
functions like factorial, Fibonacci, and sum of digits. ✔ Visualize recursion
Lesson Outcomes
using call stack diagrams. ✔ Compare recursion with iteration. ✔ Identify
base and recursive cases in a function.
- Code demonstrations and dry-runs. - Step-by-step tracing with call stack
Methods of
visualizations. - Comparison chart: recursion vs iteration. - Real-life
Pedagogy
analogies and whiteboard diagrams.
- Turbo C / Code::Blocks - Projector and laptop - Recursion flowcharts and
Teaching Tools
call stack tables - Sample code handouts
- Ask students how they might solve a problem by breaking it into smaller
Motivation/
parts. - Present factorial or number reversal as a challenge. - Introduce
Introducing the
recursion as a method of solving such problems through self-calling
Topic (5 mins)
functions.
1. What is Recursion? A function calling itself to solve a smaller instance.
2. Components: - Base Case - Recursive Case 3. Common Examples: -
Factorial - Fibonacci Series - Sum of digits - Power of a number 4. Stack
Content Behavior: Each recursive call goes into call stack. 5. Code Walkthroughs:
Presentation (40 Show complete examples and trace flow. 6. Visualization: Use diagrams to
mins) show stack push/pop actions. 7. Comparison with Iteration: Pros and cons.
8. Real-Life Analogy: Russian dolls, repeated tasks like climbing stairs. 9.
Debugging Tips: Watch for missing base case and infinite recursion. 10.
Practice Set: Write recursive functions for given patterns.
Assessment (5 1. What is required for recursion to terminate? D) Return 0 C) Stack B)
mins) Base case A) Loop Answer: B 2. What does a recursive function do? D)
Uses array C) Ends program B) Skips steps A) Calls itself Answer: A
3. What happens if base case is missing? D) No output C) Infinite
recursion B) Compilation error A) Returns 0 Answer: C 4. Which is a
recursive function example? D) int main() C) void print() B) int fact(int
n) { if(n==0) return 1; else return n*fact(n-1); } A) int sum(int a, int b)
Answer: B 5. Which structure is used to manage recursive calls? D) Heap
C) Stack B) Graph A) Queue Answer: C
Summing up (5 - Recap recursive structure: base case and recursive call. - Highlight stack
mins) usage in recursion. - Reinforce key recursive patterns.
For Slow Learners: - Provide guided tracing of factorial and sum examples.
Follow-up Work - Match problems to their recursive forms. For Advanced Learners: -
(5 mins) Implement recursive solutions for binary search or GCD. - Combine
recursion with array operations.

Lesson Plan – Application: Tower of Hanoi

Section Details
- Understand the Tower of Hanoi problem as a classic recursion application. -
Lesson Objectives Learn the recursive approach to solving Tower of Hanoi. - Implement Tower
of Hanoi algorithm in C. - Visualize disk movements and recursive calls.
✔ Describe the Tower of Hanoi problem and its rules. ✔ Write a recursive
function to solve Tower of Hanoi for n disks. ✔ Trace recursive function
Lesson Outcomes
calls and understand disk movement logic. ✔ Apply recursion to solve
logical puzzles. ✔ Analyze time complexity and growth of recursive calls.
- Visual demo using disks or animation. - Code walkthrough and dry-run. -
Methods of
Step-by-step diagram explanation. - Problem decomposition and recursion
Pedagogy
tracing.
- Turbo C / Code::Blocks - Projector and laptop - Tower of Hanoi model (or
Teaching Tools
simulation) - Whiteboard diagrams and call stack visualizers
Motivation/ - Present the Tower of Hanoi puzzle with 3 disks. - Ask: How would you
Introducing the move all disks from source to destination under the rules? - Introduce
Topic (5 mins) recursion as an elegant way to solve this puzzle.
Content 1. Problem Description: Move n disks from source to destination using an
Presentation (40 auxiliary rod. 2. Rules: - Only one disk moved at a time. - No larger disk on
mins) smaller one. - Only top disk can be moved. 3. Recursive Strategy: - Move
n-1 disks from source to auxiliary. - Move largest disk to destination. - Move
n-1 disks from auxiliary to destination. 4. Code Implementation: Recursive
function with source, destination, auxiliary parameters. 5. Example for 3
Disks: Trace all 7 moves and corresponding function calls. 6. Stack
Visualization: Recursive calls and returns during execution. 7. Time
Complexity: O(2^n - 1) moves for n disks. 8. Real-World Analogy:
Robotic arm moving stacked containers. 9. Error Points: Wrong base case,
incorrect order of recursive calls. 10. Practice: Solve for n=2, 3, 4 and trace
the moves.
1. What is the minimum number of moves for 3 disks? D) 8 C) 7 B) 6
A) 5 Answer: C 2. What technique is used to solve Tower of Hanoi? D)
Randomization C) Iteration B) Recursion A) Looping Answer: B 3.
Assessment (5 Which rod temporarily holds disks in recursive steps? D) Extra C)
mins) Auxiliary B) Destination A) Source Answer: C 4. For n disks, how many
total moves are needed? D) 2^n - 1 C) 2^n B) 2n A) n Answer: D 5.
Which condition breaks the recursion in Tower of Hanoi? C) n B) n == 1
A) n == 0 < D) top == bottom 0 Answer: B
- Recap recursive strategy and move steps. - Emphasize breakdown of
Summing up (5
problem into smaller sub-problems. - Reinforce visualization and function
mins)
tracing.
For Slow Learners: - Provide written steps and diagrams for 2-disk and 3-
Follow-up Work disk problems. - Walk through dry-run with a visual Tower of Hanoi model.
(5 mins) For Advanced Learners: - Write a function to count and print all moves for
any n. - Combine visualization with sound/graphics output in C.

Lesson Plan – Consolidated Review

Section Details
- Recap key concepts from stacks, recursion, postfix evaluation, and
expression conversion. - Reinforce programming logic through integrated
Lesson Objectives
problems. - Strengthen understanding of data structures and their real-world
use. - Prepare for cumulative assessments and practical application.
✔ Recall stack operations and recursive patterns. ✔ Trace and evaluate
postfix expressions. ✔ Convert expressions from infix to postfix. ✔ Apply
Lesson Outcomes
recursion to solve structured problems. ✔ Demonstrate problem-solving with
code and logical flow.
- Consolidated Q&A session. - Problem-solving lab: students code integrated
Methods of
problems. - Visual tracing of logic flows (call stack, stack push/pop). - Peer
Pedagogy
explanation and review.
- Turbo C / Code::Blocks - Whiteboard and projector - Cumulative review
Teaching Tools
worksheets - Dry-run tables and flowcharts for multiple operations
Motivation/ - Ask: How are recursion and stack connected? - Pose a challenge problem:
Introducing the Solve an expression using multiple concepts (e.g., convert infix to postfix
Topic (5 mins) and evaluate). - Highlight the real-world need for integrating skills.
Content 1. Review Topics: - Stack Operations (Push, Pop, Peek) - Postfix Evaluation
Presentation (40 - Infix to Postfix Conversion - Recursion & Tower of Hanoi 2. Integrated
mins) Problems: Convert, evaluate, and trace expressions using code and dry-run.
3. Visual Summary: Stack diagrams, recursive flowcharts. 4. Code Review:
Annotated samples for discussion. 5. Debugging Practice: Find and fix
issues in combined problems. 6. Real-World Use: Show layered application
like calculators and compilers. 7. Key Takeaways: Identify how topics
interconnect for deeper learning. 8. Concept Mapping: Build a visual link
between stacks, expressions, and recursion. 9. Peer Review: Pair sharing
and analysis of written solutions. 10. Wrap-Up Exercise: Solve a mixed
topic problem with group discussion.
1. What structure is used in both recursion and postfix evaluation? D)
Heap C) Stack B) Tree A) Queue Answer: C 2. Which condition is
essential in recursive functions? D) Array C) Goto B) Base case A)
Loop Answer: B 3. What does infix to postfix conversion eliminate? D)
Assessment (5 Functions C) Parentheses B) Constants A) Variables Answer: C 4.
mins) What happens when a function calls itself repeatedly without a base case? D)
Compilation halt C) Infinite recursion B) Syntax error A) Normal exit
Answer: C 5. What operation is performed in stack when evaluating AB+? D)
Store in queue C) Move A only B) Add B to A directly A) Push A and
B, add, then push result Answer: A
Summing up (5 - Recap and connect all covered concepts. - Emphasize integrated logic flow.
mins) - Prepare for assessments with holistic understanding.
For Slow Learners: - Provide integrated dry-run sheets and code templates.
Follow-up Work - Break down multi-step problems. For Advanced Learners: - Combine
(5 mins) recursion and stack logic into a custom calculator project. - Solve complex
nested expressions using full conversion and evaluation.

Lesson Plan for: Introduction to Queues

Section Details
1. Understand the concept and characteristics of queues.
Lesson Objectives 2. Learn the basic operations: enqueue and dequeue.
3. Recognize real-life applications of queues.
After the lesson, students will be able to:
✔ Define a queue and explain its working principle (FIFO).
Lesson Outcomes
✔ Perform enqueue and dequeue operations.
✔ Identify scenarios where queues are applicable.
Interactive lecture, whiteboard explanation, real-world analogies (e.g.,
Methods of Pedagogy
ticket counter), discussion.
Smart board, slide presentation, visual diagrams of queues, real-life
Teaching Tools
videos (e.g., printer queue simulation).
Begin by asking students how a line works at a movie theater or bus stop.
Motivation / Introducing
Ask: “What happens if someone tries to cut in?”
the Topic (5 min)
Introduce the term ‘Queue’ in computer science as a similar structure.
Content Presentation – - Definition: A queue is a linear data structure that follows FIFO (First
Key Points (40 min) In, First Out).
- Basic Operations:
→ Enqueue (insert at rear)
Section Details
→ Dequeue (remove from front)
- Types of Queues:
→ Simple Queue
→ Circular Queue
→ Priority Queue
→ Double-ended Queue (Deque)
- Applications:
→ CPU scheduling
→ Disk scheduling
→ Printer queues
→ Call center systems
- Queue Representation:
→ Using Arrays
→ Using Linked Lists
Assessment: MCQs (5 Multiple Choice Questions:
min) 1. What is the order of processing in a queue?
A) LIFO
B) FILO
C) FIFO
D) Random
Answer: C

2. Which operation inserts an element into a queue?


A) Delete
B) Enqueue
C) Dequeue
D) Pop
Answer: B

3. Which of the following is an application of queues?


A) Expression evaluation
B) Function recursion
C) Printer scheduling
D) Binary tree traversal
Answer: C

4. What happens when we try to dequeue from an empty queue?


A) Overflow
B) Underflow
C) Garbage value
D) Nothing
Answer: B

5. Which type of queue allows insertion and deletion from both ends?
A) Simple queue
Section Details
B) Circular queue
C) Deque
D) Priority queue
Answer: C
Summing Up (5 min) Reinforce FIFO principle.
Summarize types of queues and their uses.
Encourage students to identify queues in their daily environment.
Slow Learners: Provide animated visualizations and step-by-step
worksheets on enqueue and dequeue.
Follow-up Work
Advanced Learners: Assign tasks to implement queue using linked list
and explore circular queue and priority queue with code examples.

Lesson Plan for: Circular Queues

Section Details
1. Understand the concept and need for circular queues.
Lesson Objectives 2. Learn how circular queues overcome the limitations of linear queues.
3. Perform enqueue and dequeue operations in a circular queue.
After the lesson, students will be able to:
✔ Define and represent a circular queue.
Lesson Outcomes ✔ Explain front and rear pointer logic in circular queues.
✔ Implement enqueue and dequeue operations in a circular queue using
arrays.
Chalk and board method, code simulation, real-life examples like
Methods of Pedagogy
rotating ticket counters.
Smart board, presentation slides, whiteboard diagrams, dry-erase
Teaching Tools
circular queue demo, animations.
Motivation / Ask students what happens when all seats in a row are filled in a round-
Introducing the Topic robin game? Can we reuse seats? Explain that linear queues waste space.
(5 min) This leads to the concept of Circular Queues.
Content Presentation – - Definition: Circular Queue is a linear data structure in which the last
Key Points (40 min) position is connected back to the first, forming a circle.
- Need: Solves the ‘false overflow’ problem of linear queues.
- Working Mechanism:
→ Enqueue at (rear + 1) % size
→ Dequeue at front and increment front as (front + 1) % size
- Key Conditions:
→ Full: (rear + 1) % size == front
→ Empty: front == -1
- Operations:
→ Enqueue
→ Dequeue
→ Display
Section Details
- Applications:
→ CPU scheduling
→ Memory management
→ Circular buffering (audio/video streaming)
Multiple Choice Questions:
1. What makes a queue “circular”?
A) It uses circular buffers
B) The rear wraps to the front
C) It deletes circularly
D) None of the above
Answer: B

2. What is the condition for a circular queue to be full?


A) rear == front
B) front == 0
C) (rear + 1) % size == front
D) rear == size - 1
Answer: C

3. Which condition indicates an empty circular queue?


A) rear == size
Assessment: MCQs (5
B) front == rear + 1
min)
C) front == -1
D) rear == 0
Answer: C

4. What is the formula to insert an element in a circular queue?


A) rear = (rear + 1)
B) rear = rear + front
C) rear = (rear + 1) % size
D) rear = rear - 1
Answer: C

5. Circular queues are best suited for:


A) Priority scheduling
B) Last-in-first-out processing
C) Round-robin scheduling
D) Binary tree traversal
Answer: C
Review how circular queues save space compared to linear queues.
Summing Up (5 min)
Explain practical uses like CPU scheduling and buffer management.
Slow Learners: Provide dry-run worksheets and visual simulations of
enqueue and dequeue.
Follow-up Work
Advanced Learners: Implement circular queues using both arrays and
linked lists. Ask to compare space complexity and performance.
Lesson Plan for: Deques and Priority Queues

Section Details
1. Understand the structure and operations of Deques (Double-ended
Queues) and Priority Queues.
Lesson Objectives 2. Identify the differences between Deque and other types of queues.
3. Learn how Priority Queues work based on priority rather than
position.
After the lesson, students will be able to:
✔ Define Deque and Priority Queue.
✔ Perform insert and delete operations from both ends in a Deque.
Lesson Outcomes
✔ Explain the working of Priority Queues with priority-based
element access.
✔ Implement and differentiate these queues.
Interactive explanation, real-world comparisons (e.g., hospital
Methods of Pedagogy
emergency rooms for priority queue), flowcharts, live coding demo.
Projector, flow diagrams, animations for queue behavior, sample
Teaching Tools
codes (C/Python), cards for physical demo.
Start with examples:
→ A waiting line where people are added at both ends (Deque).
Motivation / Introducing
→ A hospital ER where patients are treated based on severity
the Topic (5 min)
(Priority Queue).
Ask: “Is position always the right way to serve people in a queue?”
- Deque (Double-Ended Queue):
→ Elements can be inserted and deleted from both front and rear.
→ Types:
→ Input-restricted Deque
→ Output-restricted Deque
→ Used in undo operations, palindromes, scheduling.
Content Presentation –
- Priority Queue:
Key Points (40 min)
→ Elements are served based on priority, not just position.
→ Higher-priority items are dequeued before lower-priority ones.
→ Can be implemented using:
→ Arrays (sorted/unsorted)
→ Heaps
→ Applications: OS task scheduling, bandwidth management,
simulation queues.
Assessment: MCQs (5 Multiple Choice Questions:
min) 1. What does a Deque allow?
A) Insert at rear only
B) Delete from front only
Section Details
C) Insert and delete from both ends
D) Only read operations
Answer: C

2. What is a Priority Queue based on?


A) Insertion order
B) FIFO
C) Priority levels
D) Memory address
Answer: C

3. Which data structure is typically used for implementing a priority


queue efficiently?
A) Stack
B) Array
C) Heap
D) Linked List
Answer: C

4. A Deque with insertion restricted to rear and deletion only from


front is called:
A) Input-restricted Deque
B) Output-restricted Deque
C) Simple Queue
D) Priority Queue
Answer: A

5. Priority queues are best suited for:


A) Undo features
B) Stack reversal
C) Emergency services
D) Polynomial evaluation
Answer: C
Recap key differences between Deque and Priority Queue.
Summing Up (5 min) Discuss how priorities affect service order.
Highlight where each structure is practically useful.
Slow Learners: Use step-by-step card-based examples for
enqueue/dequeue in Deques and Priority Queues.
Follow-up Work
Advanced Learners: Implement a priority queue using heaps and
compare with array-based implementation.

Lesson Plan for: Applications of Queues – Simulation


Section Details
1. Understand how queues are used in simulation.
2. Learn to model real-world scenarios using queues.
Lesson Objectives
3. Analyze queue-based behavior in system design and
performance.
After the lesson, students will be able to:
✔ Explain the role of queues in real-time simulations.
Lesson Outcomes ✔ Model systems like customer service centers or traffic lights
using queues.
✔ Identify suitable types of queues for different simulation needs.
Visual explanation with flowcharts, role play simulation, software
Methods of Pedagogy
demo (e.g., queueing simulator tools), use-case discussion.
Smart board, simulation applets, slides with simulation diagrams
Teaching Tools
(banking, call centers), simple Python/Java simulations.
Pose a real-life question: “What happens if 100 people try to
Motivation / Introducing
withdraw money from a bank with only 2 counters?”
the Topic (5 min)
Discuss the waiting line behavior and introduce queue simulation.
- Queue Simulation:
→ Modeling real-world queues to analyze performance.
- Common Scenarios:
→ Bank teller systems
→ Call centers
→ Ticket counters
→ Supermarkets
→ Traffic light management
- Simulation Parameters:
Content Presentation – Key
→ Arrival time, service time, queue length, waiting time
Points (40 min)
- Types of Queues Used:
→ Simple Queue, Circular Queue, Priority Queue
- Benefits:
→ Optimized resource usage
→ Improved customer satisfaction
→ Cost-effective staffing
- Simulation Tools:
→ Manual modeling, spreadsheets, JavaScript simulators,
Python libraries
Assessment: MCQs (5 min) Multiple Choice Questions:
1. What does a queue simulation typically model?
A) Memory allocation
B) Waiting line behavior
C) Sorting data
D) Searching algorithms
Answer: B

2. Which of the following is an example of queue simulation?


A) Binary search tree traversal
Section Details
B) Polynomial evaluation
C) Call center service
D) Stack reversal
Answer: C

3. Which parameter is important in queue simulations?


A) Page number
B) Arrival time
C) Compilation time
D) Code size
Answer: B

4. Which type of queue is used for patient emergency handling in


simulations?
A) Deque
B) Simple queue
C) Priority queue
D) Stack
Answer: C

5. What is the purpose of simulating a queue system?


A) To increase hardware speed
B) To sort elements
C) To optimize resource utilization and reduce waiting time
D) To break program flow
Answer: C
Summing Up (5 min) Revisit the importance of queue simulations in real life.
Review case examples like ATM queues and hospital triage.
Ask students to brainstorm other applications.
Slow Learners: Use real-life analogy worksheets (e.g., food truck
queue) and guided simulation examples.
Follow-up Work
Advanced Learners: Build a queue simulation in code to compare
FIFO vs. priority-based outcomes.

Lesson Plan for: Applications of Queues – CPU Scheduling

Section Details
1. Understand how queues are used in CPU scheduling.
Lesson Objectives 2. Learn the different scheduling algorithms that utilize queues.
3. Analyze queue-based scheduling performance and behavior.
Lesson Outcomes After the lesson, students will be able to:
✔ Explain how a CPU scheduler uses queues.
✔ Identify types of scheduling queues (ready queue, waiting
Section Details
queue).
✔ Understand Round Robin, FCFS, and Priority Scheduling using
queue structures.
Lecture using diagrams and animations, system simulation,
Methods of Pedagogy analogies (e.g., ticket counters, CPU task rotations), Q&A
discussion.
Slides with scheduling algorithms, CPU state diagrams, Gantt
Teaching Tools
charts, task queue visualizations, live simulation tools.
Pose a question: “What if multiple programs want to use the CPU at
Motivation / Introducing once?”
the Topic (5 min) Show an animated simulation where tasks are scheduled using
queue mechanisms.
- CPU Scheduling:
→ The mechanism of deciding which process gets CPU time.
- Types of Scheduling Queues:
→ Ready queue (processes waiting for CPU)
→ Waiting queue (processes waiting for I/O)
- Scheduling Algorithms Using Queues:
Content Presentation – → First Come First Serve (FCFS) – Simple queue
Key Points (40 min) → Round Robin – Circular queue
→ Priority Scheduling – Priority queue
→ Multilevel Queue – Multiple queues with different criteria
- Key Metrics:
→ Waiting time
→ Turnaround time
→ CPU utilization
Assessment: MCQs (5 min) Multiple Choice Questions:
1. Which queue stores processes waiting to use the CPU?
A) Job queue
B) I/O queue
C) Ready queue
D) Device queue
Answer: C

2. Which scheduling algorithm uses circular queues?


A) FCFS
B) Shortest Job First
C) Round Robin
D) Priority Scheduling
Answer: C

3. What is the main advantage of Round Robin scheduling?


A) Minimizes memory
B) Equal CPU time for all processes
C) Fastest turnaround
Section Details
D) No need for queues
Answer: B

4. In which type of scheduling does the highest priority process


execute first?
A) FIFO
B) Round Robin
C) FCFS
D) Priority Scheduling
Answer: D

5. What data structure is most used in FCFS scheduling?


A) Stack
B) Queue
C) Heap
D) Graph
Answer: B
Recap how queues organize CPU-bound tasks.
Discuss when to use different scheduling approaches (e.g., Round
Summing Up (5 min)
Robin vs. Priority).
Highlight practical importance in OS design.
Slow Learners: Use visual Gantt charts and simulate FCFS and
Round Robin manually.
Follow-up Work
Advanced Learners: Write code to implement different scheduling
algorithms and analyze their efficiency.

Lesson Plan for: Applications of Queues – Round Robin Algorithm

Section Details
1. Understand the working of the Round Robin CPU scheduling
algorithm.
Lesson Objectives 2. Learn how queues (specifically circular queues) are applied in
task rotation.
3. Calculate waiting and turnaround times using Round Robin.
After the lesson, students will be able to:
✔ Define the Round Robin algorithm and explain its steps.
✔ Implement Round Robin using circular queues.
Lesson Outcomes
✔ Compute performance metrics like average waiting time.
✔ Distinguish Round Robin from other algorithms like FCFS or
Priority.
Diagram-based explanation, sample problem-solving, task rotation
Methods of Pedagogy
analogy (e.g., students taking turns), whiteboard queue simulation.
Teaching Tools Gantt chart visualizer, CPU scheduling simulator, whiteboard, PPT
Section Details
slides, sample process tables.
Ask: “What happens if you give equal time to each program running
Motivation / Introducing on your system?”
the Topic (5 min) Demonstrate this through a small game (e.g., giving students 5
seconds each to speak in a loop).
- Round Robin Algorithm:
→ Each process gets a fixed time slice (quantum).
→ After the quantum expires, the process goes to the back of the
queue.
- Data Structure Used:
→ Circular Queue to rotate processes.
- Advantages:
→ Fair allocation of CPU
→ Simple and easy to implement
Content Presentation –
- Disadvantages:
Key Points (40 min)
→ Poor for processes with short burst time
→ Overhead from frequent context switches
- Use Cases:
→ Time-sharing systems
→ Multitasking OS environments
- Metrics Calculated:
→ Waiting Time
→ Turnaround Time
→ Throughput
Assessment: MCQs (5 Multiple Choice Questions:
min) 1. Round Robin algorithm is based on which queue structure?
A) Stack
B) Linear queue
C) Circular queue
D) Priority queue
Answer: C

2. What is the time slice in Round Robin scheduling?


A) The time after which I/O is completed
B) The amount of time allotted to each process
C) The total time of execution
D) Process start time
Answer: B

3. Round Robin is ideal for:


A) Real-time tasks
B) Long-running batch jobs
C) Time-sharing systems
D) Single-user OS
Answer: C
Section Details

4. What happens if a process doesn’t complete in its time slice?


A) It’s discarded
B) It continues
C) It moves to the end of the queue
D) It is paused permanently
Answer: C

5. What is the major disadvantage of Round Robin scheduling?


A) Starvation
B) Context switching overhead
C) Deadlock
D) Infinite loop
Answer: B
Recap the working of Round Robin and its use of circular queues.
Summing Up (5 min) Compare Round Robin with FCFS and Priority Scheduling.
Highlight situations where Round Robin is optimal.
Slow Learners: Provide process tables and walk through Round
Robin step-by-step using Gantt charts.
Follow-up Work
Advanced Learners: Implement a Round Robin simulator in
Python or C to analyze performance metrics for different time slices.

Lesson Plan for: Introduction to Linked Lists

Section Details
1. Introduce the concept of linked lists as a dynamic data structure.
2. Understand how nodes are connected via pointers.
Lesson Objectives
3. Learn how linked lists differ from arrays in terms of memory
management.
After the lesson, students will be able to:
✔ Define a linked list and its structure.
Lesson Outcomes ✔ Explain the role of pointers in linking nodes.
✔ Identify advantages and limitations compared to arrays.
✔ Draw and trace linked list operations conceptually.
Visual diagrams, pointer tracing, analogies (e.g., train coaches),
Methods of Pedagogy
interactive walkthroughs using pen-and-paper models.
Whiteboard and markers, slides with pointer-based diagrams, linked
Teaching Tools
list animations, sample C/Python programs, hands-on pointer cards.
Motivation / Introducing Ask: “What happens when you need to add more items to an array,
the Topic (5 min) but it’s already full?”
Use this to introduce linked lists as dynamic structures that grow as
Section Details
needed.
- Definition: A Linked List is a linear data structure where each
element (node) points to the next.
- Structure of a Node:
→ Data
→ Pointer to next node
- Types:
→ Singly Linked List
→ Doubly Linked List
Content Presentation –
→ Circular Linked List
Key Points (40 min)
- Advantages over Arrays:
→ Dynamic size
→ Easy insertion/deletion
- Limitations:
→ Sequential access only
→ More memory due to pointers
- Basic Terminology:
→ Head, Node, NULL pointer, Link
Assessment: MCQs (5 Multiple Choice Questions:
min) 1. What does each node in a singly linked list contain?
A) Only data
B) Data and pointer to next node
C) Two pointers
D) Data and index
Answer: B

2. The last node of a singly linked list points to:


A) Head
B) NULL
C) Random node
D) Previous node
Answer: B

3. What is the major advantage of linked lists over arrays?


A) Faster access
B) Fixed size
C) Dynamic memory allocation
D) Better sorting
Answer: C

4. What is the first node of a linked list called?


A) First
B) Start
C) Top
D) Head
Section Details
Answer: D

5. In a linked list, elements are stored:


A) Contiguously
B) In registers
C) At random memory locations
D) In a stack\nAnswer: C
Reinforce the need for dynamic structures.
Summing Up (5 min) Compare static vs. dynamic storage visually.
Encourage students to draw their own linked list diagrams.
Slow Learners: Use card-based or paper models to manually link
nodes.
Follow-up Work
Advanced Learners: Implement a simple singly linked list in code,
add insertion and traversal.

Lesson Plan for: Singly Linked Lists

Section Details
1. Understand the structure and functioning of singly linked lists.
Lesson Objectives 2. Learn how to create, insert, delete, and traverse singly linked lists.
3. Understand the use of pointers and node connections.
After the lesson, students will be able to:
✔ Describe the structure of a singly linked list.
Lesson Outcomes ✔ Implement insertion and deletion at various positions.
✔ Traverse a singly linked list to access elements.
✔ Differentiate between static and dynamic memory usage.
Step-by-step coding demo, flowchart drawing, hands-on pointer
Methods of Pedagogy tracing activity, real-world analogy (e.g., linking train
compartments).
Slide presentation with diagrams, whiteboard examples, sample code
Teaching Tools
walkthroughs (C/Python), animation tools for node linking.
Ask: “What happens if you want to insert an element in the middle
Motivation / Introducing of an array?”
the Topic (5 min) Use this to show the inefficiency of arrays and motivate the use of
singly linked lists.
Content Presentation – - Node Structure:
Key Points (40 min) → Contains data and pointer to the next node.
- Basic Operations:
→ Creation of a node
→ Insertion:
• At beginning
• At end
Section Details
• After a specific node
→ Deletion:
• First node
• Last node
• Specific node
→ Traversal:
• Loop through each node from head to NULL
- Implementation using struct/class
- Use Cases:
→ Dynamic data storage
→ Symbol tables
→ Real-time memory-efficient applications
Assessment: MCQs (5 Multiple Choice Questions:
min) 1. Which of the following is true for a singly linked list?
A) Each node has two pointers
B) Nodes are stored contiguously
C) Each node points to the next node
D) Each node points to previous and next
Answer: C

2. In a singly linked list, what does the last node’s pointer contain?
A) Address of first node
B) NULL
C) Garbage value
D) Address of middle node
Answer: B

3. What is required to traverse a singly linked list?


A) Stack
B) Queue
C) Loop from head to NULL
D) Goto statement
Answer: C

4. How can you insert a node at the beginning of a singly linked list?
A) Traverse to the end and link
B) Make new node point to head, then update head
C) Point new node to NULL
D) Swap data fields
Answer: B

5. Which is the time complexity for inserting a node at the end


(without tail pointer)?
A) O(1)
B) O(n)
Section Details
C) O(log n)
D) O(n²)
Answer: B
Recap the operations on singly linked lists: creation, insertion,
deletion, and traversal.
Summing Up (5 min)
Compare with arrays and highlight advantages in dynamic memory
management.
Slow Learners: Provide pre-drawn node diagrams and have students
manually walk through insert/delete operations.
Follow-up Work
Advanced Learners: Write full programs to build, insert, delete,
and traverse a singly linked list with user inputs.

Lesson Plan for: Singly Linked List Operations

Section Details
1. Learn to perform core operations on singly linked lists.
2. Understand pointer manipulation for insertions and deletions.
Lesson Objectives
3. Gain confidence in writing functions to operate on singly linked
lists.
After the lesson, students will be able to:
✔ Implement insertion (beginning, end, middle) in a singly linked
list.
Lesson Outcomes
✔ Delete nodes from various positions.
✔ Traverse and search through a singly linked list.
✔ Handle corner cases (empty list, single node list).
Code tracing, dry-run activities, pointer flowcharts, structured
Methods of Pedagogy
problem solving, pair programming.
Board diagrams, IDE demonstrations, code walkthroughs in C or
Teaching Tools
Python, pointer role play using cards/props.
Ask: “Have you ever tried inserting a value in the middle of an
Motivation / Introducing array?”
the Topic (5 min) Discuss how singly linked lists make this easier using pointers.
Show a short code snippet and ask students what it does.
Content Presentation – Key - Traversal:
Points (40 min) → Start from head and move to next until NULL.
- Insertion:
→ At beginning: new node → head; update head
→ At end: traverse to last node and link
→ At specific position: navigate, link, update
- Deletion:
→ From beginning: update head
→ From end: traverse to second last, set next to NULL
Section Details
→ Specific node by value or position
- Search Operation:
→ Traverse and compare data
- Edge Case Handling:
→ Empty list, invalid position, deleting only node
Multiple Choice Questions:
1. What is the first step in deleting the first node of a singly linked
list?
A) Free the head
B) Make the head NULL
C) Update head to head->next
D) Move head to tail
Answer: C

2. What is necessary before inserting at a specific position?


A) Traverse to the last node
B) Count the number of nodes
C) Traverse to the node just before
D) Traverse in reverse
Answer: C

3. What happens if you try to traverse an empty list?


A) Program crashes
Assessment: MCQs (5 min) B) Prints NULL
C) Nothing happens
D) Goes into infinite loop
Answer: C

4. Which function is used to free a deleted node in C?


A) release()
B) malloc()
C) delete()
D) free()
Answer: D

5. Time complexity of insertion at the beginning of a singly linked


list is:
A) O(n)
B) O(1)
C) O(n log n)
D) O(n²)
Answer: B
Revisit: Insert → Delete → Traverse → Search.
Summing Up (5 min) Emphasize pointer direction and NULL handling.
Encourage diagramming operations to aid understanding.
Section Details
Slow Learners: Give worksheet-based exercises to practice
insert/delete step by step.
Follow-up Work
Advanced Learners: Implement all operations using modular
functions and handle exceptions with user prompts.

Lesson Plan for: Circular Linked Lists

Section Details
1. Understand the structure and purpose of circular linked lists.
2. Learn operations such as insertion, deletion, and traversal in
Lesson Objectives circular lists.
3. Distinguish circular linked lists from singly and doubly linked
lists.
After the lesson, students will be able to:
✔ Define a circular linked list and explain its structure.
Lesson Outcomes ✔ Implement and trace circular linked list operations.
✔ Compare circular linked list with singly and doubly linked lists.
✔ Identify real-world applications of circular linked lists.
Step-by-step visual demonstrations, animations, group
Methods of Pedagogy
walkthroughs, live code simulation, peer explanations.
Whiteboard diagrams (circular structure), slides, code examples (C,
Teaching Tools
Python), pointer models, animation or video demos.
Ask: “Can you think of something that starts again once it ends,
Motivation / Introducing like a playlist or round-robin game?”
the Topic (5 min) Introduce circular lists using real-life analogy (e.g., rotating player
turns, musical chairs).
Content Presentation – Key - Definition: A linked list where the last node points to the first
Points (40 min) node.
- Types:
→ Singly Circular Linked List
→ Doubly Circular Linked List
- Structure:
→ Node with data and next pointer
→ Last node’s next points to head
- Operations:
→ Insertion (at beginning, end, position)
→ Deletion (from beginning, end, position)
→ Traversal using do-while or loop with head check
- Advantages:
→ No NULL needed
→ Continuous looping
Section Details
- Applications:
→ Music playlists, real-time task scheduling, multiplayer games,
round-robin CPU scheduling
Multiple Choice Questions:
1. In a circular linked list, what does the last node point to?
A) NULL
B) Itself
C) The head node
D) Next-to-last node
Answer: C

2. Which loop is commonly used for traversing circular linked


lists?
A) for loop
B) while loop
C) do-while loop
D) nested loop
Answer: C

3. Which of the following is true for circular linked lists?


A) Last node contains NULL
Assessment: MCQs (5 min) B) Traversal ends at NULL
C) Last node points to first
D) First node points to NULL
Answer: C

4. Circular linked lists are best suited for:


A) Reversing strings
B) Static memory
C) Recursion
D) Applications that repeat cyclically
Answer: D

5. What is a major benefit of circular linked lists over singly linked


lists?
A) Simpler to implement
B) Do not require head node
C) Can be traversed from any node
D) Random access
Answer: C
Summing Up (5 min) Summarize the circular nature and advantages of CLLs.
Compare circular lists with other types.
Revisit use cases like scheduling, looping tasks.
Follow-up Work Slow Learners: Use paper cutouts to simulate circular linking and
repeat pointer traversal.
Section Details
Advanced Learners: Implement full CLLs with insertion/deletion
and validate loop conditions through dry runs.

Lesson Plan for: Doubly Linked Lists

Section Details
1. Understand the structure and behavior of doubly linked lists.
2. Learn to perform operations like insertion, deletion, and traversal.
Lesson Objectives
3. Differentiate between singly and doubly linked lists based on
access and memory use.
After the lesson, students will be able to:
✔ Describe the structure of a doubly linked list with previous and
next pointers.
Lesson Outcomes
✔ Perform bidirectional traversal.
✔ Implement insertions and deletions at various positions.
✔ Compare singly and doubly linked list usage.
Diagram-based teaching, pointer mapping, real-world analogies (e.g.,
Methods of Pedagogy metro lines with forward and backward directions), live coding
demo.
Smartboard, node linking cutouts, pointer flow animations, IDE
Teaching Tools
coding examples (C/Python), comparison tables.
Ask: “What if you want to go both forward and backward in a list—
Motivation / Introducing
like viewing browser history or editing undo/redo?”
the Topic (5 min)
Use this analogy to introduce Doubly Linked Lists.
Content Presentation – - Definition: Each node contains:
Key Points (40 min) → Data
→ Pointer to next node
→ Pointer to previous node
- Operations:
→ Insertion:
• At beginning
• At end
• At a given position
→ Deletion:
• From beginning
• From end
• By value
- Traversal:
→ Forward and backward from any node
- Advantages:
→ Bi-directional traversal
→ Easier node deletion (no need for tracking previous)
- Disadvantages:
Section Details
→ More memory usage
→ Slightly complex to implement
Multiple Choice Questions:
1. What does a node in a doubly linked list contain?
A) Only data
B) Data and one pointer
C) Data and two pointers
D) Data and three pointers
Answer: C

2. Which direction can you traverse a doubly linked list?


A) Only forward
B) Only backward
C) Both forward and backward
D) Randomly
Answer: C

3. What is a disadvantage of doubly linked lists?


A) Cannot be traversed
Assessment: MCQs (5
B) Cannot store characters
min)
C) Extra memory usage for back pointer
D) Cannot be implemented in C
Answer: C

4. In deletion from a doubly linked list, what is updated first?


A) Next of previous node
B) Previous of next node
C) Both A and B
D) Data value
Answer: C

5. Which of the following is a practical use of doubly linked lists?


A) Binary trees
B) Web browser navigation (back/forward)
C) Array sorting
D) File compression
Answer: B
Highlight the bidirectional feature and practical relevance (e.g.,
undo/redo).
Summing Up (5 min)
Compare DLL with singly and circular linked lists.
Encourage drawing and dry-run of insert/delete ops.
Slow Learners: Provide node diagrams with arrows and assist in
tracing insert/delete visually.
Follow-up Work
Advanced Learners: Write modular programs in C to build a DLL
with forward and reverse display functions.
Lesson Plan for: Doubly Linked List Operations

Section Details
1. Learn how to perform various operations on doubly linked lists.
Lesson Objectives 2. Understand pointer adjustments for insertions and deletions.
3. Practice bidirectional traversal and edge-case handling.
After the lesson, students will be able to:
✔ Implement insertion at beginning, end, and specified position.
Lesson Outcomes ✔ Delete nodes from any position in a DLL.
✔ Traverse the list in both directions.
✔ Maintain pointer links correctly during all operations.
Code demonstration, pointer simulation, flowchart-based tracing,
Methods of Pedagogy
compare-and-contrast exercises with singly linked lists.
Whiteboard, linked list animations, pointer cards, structured
Teaching Tools
programming examples (C/Python), GDB visual walkthroughs.
Ask: “What if you could travel a list from any direction and delete
Motivation / Introducing
nodes easily without tracking the previous node manually?”
the Topic (5 min)
Introduce DLL operations as the answer to such flexibility.
- Traversal:
→ Forward from head to NULL
→ Backward from tail to head
- Insertion:
→ At beginning: Update new node’s next to head, set head’s
prev
→ At end: Traverse, set tail’s next to new node, set new node’s
Content Presentation – prev
Key Points (40 min) → At a given position: Navigate, update both next and prev links
- Deletion:
→ From beginning: head = head->next; update head->prev =
NULL
→ From end: tail = tail->prev; update tail->next = NULL
→ From specific node: adjust prev->next and next->prev
- Edge Case Handling:
→ Empty list, single node list, invalid position
Assessment: MCQs (5 min) Multiple Choice Questions:
1. Which of the following is required for deleting a node in a
doubly linked list?
A) Only next pointer
B) Only data
C) Both next and previous pointers
D) Only previous pointer
Answer: C
Section Details

2. In forward traversal, which pointer is used?


A) prev
B) next
C) head
D) tail
Answer: B

3. What is the time complexity to insert a node at the end of a DLL


(without tail pointer)?
A) O(n)
B) O(1)
C) O(n log n)
D) O(n²)
Answer: A

4. Which pointer must be updated when inserting at the beginning?


A) head only
B) head->next only
C) New node's next and head's prev
D) Only tail
Answer: C

5. What is the advantage of DLL in deletion compared to SLL?


A) Less space
B) No need to find previous node explicitly
C) Faster traversal
D) Easier implementation
Answer: B
Review insertion and deletion rules with diagrams.
Emphasize updating both next and prev links.
Summing Up (5 min)
Reinforce why DLL is powerful for bidirectional access and
modifications.
Slow Learners: Use arrow-marked cards to simulate updates in
steps.
Follow-up Work
Advanced Learners: Create a full menu-driven program
implementing DLL operations and test edge cases.

Lesson Plan for: Circular Doubly Linked Lists

Section Details
Lesson Objectives 1. Understand the structure of circular doubly linked lists (CDLLs).
Section Details
2. Learn how to insert, delete, and traverse CDLLs in both
directions.
3. Compare CDLLs with singly, doubly, and circular singly linked
lists.
After the lesson, students will be able to:
✔ Define a Circular Doubly Linked List and explain how it differs
from other lists.
Lesson Outcomes ✔ Perform insertion and deletion at front, end, and specific
positions.
✔ Traverse the list in forward and backward directions.
✔ Implement CDLLs programmatically.
Stepwise visual flowcharts, pointer diagram demonstration, live
Methods of Pedagogy
coding session, interactive pointer tracing using cards.
Whiteboard, animated diagrams, C/Python code samples, paper
Teaching Tools
node chains (front, rear, prev, next), Gantt-style visual links.
Ask: “What if you could move endlessly back and forth across data
Motivation / Introducing in a loop, like a music playlist or navigation system?”
the Topic (5 min) Introduce Circular Doubly Linked Lists as a structure that
supports such operations.
- Definition: A doubly linked list where the last node’s next points
to the first, and the first node’s prev points to the last.
- Node Structure:
→ Data
→ Pointer to next
→ Pointer to previous
- Operations:
→ Insertion:
• At front
• At end
• At any position
→ Deletion:
Content Presentation –
• From front/end
Key Points (40 min)
• By value or position
- Traversal:
→ Forward and backward using do-while loop or condition
checks
- Advantages:
→ Infinite navigation
→ Simplified wrap-around logic
→ Efficient bidirectional circular control
- Applications:
→ Music/video players
→ Carousel interfaces
→ Multiplayer game loops
Assessment: MCQs (5 min) Multiple Choice Questions:
Section Details
1. What does the ‘next’ pointer of the last node in a CDLL point to?
A) NULL
B) Random node
C) First node
D) Middle node
Answer: C

2. What does the ‘prev’ pointer of the first node in a CDLL point
to?
A) NULL
B) Second node
C) Tail node
D) Itself
Answer: C

3. What type of loop is commonly used in CDLL traversal?


A) For loop
B) Infinite loop
C) Do-while loop
D) Goto loop
Answer: C

4. Which of the following is true for CDLLs?


A) Only backward traversal is possible
B) Nodes are not connected
C) They use both next and prev pointers with circular links
D) They use stack logic
Answer: C

5. CDLLs are best used when:


A) Fixed memory is required
B) Forward-only access is sufficient
C) Infinite bidirectional traversal is needed
D) Arrays are too slow
Answer: C
Review pointer updates and circular linking logic.
Summing Up (5 min) Contrast CDLL with DLL and Circular Singly Linked List.
Discuss its relevance in continuous looping applications.
Slow Learners: Use hands-on tracing of prev-next updates via node
cards.
Follow-up Work
Advanced Learners: Implement full CDLL operations with edge-
case handling (e.g., single node, full circle delete).
Lesson Plan for: Application – Polynomial Representation Using Linked Lists

Section Details
1. Understand how to represent polynomials using linked lists.
2. Learn how each term is stored as a node containing coefficient
Lesson Objectives and exponent.
3. Perform polynomial operations such as addition and display
using linked lists.
After the lesson, students will be able to:
✔ Represent a polynomial as a linked list.
Lesson Outcomes ✔ Store and access terms based on exponents.
✔ Add two polynomials using linked list operations.
✔ Display a polynomial in human-readable format.
Diagrammatic explanation, dry-run exercises, node-based matching
Methods of Pedagogy
activity, practical coding examples.
Slides with polynomial examples, whiteboard for term mapping,
Teaching Tools
paper nodes (coeff, expo), coding examples in C/Python.
Ask: “How do we store and operate on expressions like 3x² + 5x +
Motivation / Introducing 7 in a computer program?”
the Topic (5 min) Use this to introduce the idea of linked lists storing each term as a
node.
- Why Linked Lists for Polynomials?:
→ Dynamic memory for unknown number of terms
→ Easy insertion and merging by exponent
- Node Structure:
→ Coefficient
→ Exponent
→ Pointer to next node
Content Presentation – Key
- Operations:
Points (40 min)
→ Creation of a polynomial (node by node)
→ Addition of two polynomials:
• Traverse both lists simultaneously
• Combine like terms (same exponents)
• Store in a new linked list
→ Display:
• Traverse and print in standard form
Assessment: MCQs (5 min) Multiple Choice Questions:
1. What does a node in a polynomial linked list contain?
A) Only coefficient
B) Coefficient and pointer
C) Coefficient, exponent, and next pointer
D) Only exponent
Answer: C

2. Why are linked lists used for polynomial representation?


Section Details
A) Fixed size
B) Faster I/O
C) Dynamic and efficient for unknown terms
D) Supports recursion
Answer: C

3. In polynomial addition, what happens when two terms have the


same exponent?
A) Exponents are added
B) Nodes are discarded
C) Coefficients are added
D) Nothing is done
Answer: C

4. What is the time complexity of adding two polynomials of


degree n each (sorted)?
A) O(1)
B) O(n)
C) O(n²)
D) O(log n)
Answer: B

5. Which pointer is updated while linking polynomial terms?


A) prev
B) random
C) next
D) top
Answer: C
Recap node structure (coeff, expo, next) and logic of polynomial
addition.
Summing Up (5 min)
Use diagram to trace addition of like terms.
Compare with array-based implementation briefly.
Slow Learners: Use term cards and physical linking to simulate
addition.
Follow-up Work
Advanced Learners: Write a full program to accept, add, and
display polynomials with variable number of terms.

Lesson Plan for: Consolidated Review – Linked Lists

Section Details
Lesson Objectives 1. Recap key concepts related to all types of linked lists.
2. Reinforce understanding of structure, operations, and
Section Details
applications.
3. Clarify common doubts and prepare students for evaluations.
After the session, students will be able to:
✔ Differentiate between singly, doubly, circular, and circular
doubly linked lists.
Lesson Outcomes ✔ Confidently explain how insertion, deletion, and traversal
work.
✔ Identify appropriate use cases for each type of linked list.
✔ Analyze pointer relationships across node structures.
Quiz-based interaction, comparison tables, recap charts,
Methods of Pedagogy
flashcards, peer-led group summaries.
Review slides, whiteboard diagrams, linked list classification
Teaching Tools
tables, rapid-fire Q&A, visual flashcards.
Begin by asking: “Can you name all the types of linked lists
Motivation / Introducing the
we’ve studied?”
Topic (5 min)
List them together, and say: “Today, we’re connecting the dots.”
- Types of Linked Lists Recap:
→ Singly Linked List (SLL)
→ Doubly Linked List (DLL)
→ Circular Linked List (CLL)
→ Circular Doubly Linked List (CDLL)
- Operations Summary:
→ Insertion
→ Deletion
→ Traversal
Content Presentation – Key
- Comparative Table:
Points (40 min)
→ Direction, memory usage, use cases
- Common Mistakes Reviewed:
→ Forgetting to update pointers
→ Infinite loops in circular lists
→ Missing NULL check
- Quick Review of Applications:
→ Polynomial representation
→ Memory allocation
→ Undo/redo features
Assessment: MCQs (5 min) Multiple Choice Questions:
1. Which linked list supports backward traversal?
A) Singly linked list
B) Doubly linked list
C) Circular singly linked list
D) None
Answer: B

2. What makes a circular doubly linked list unique?


A) It contains two heads
Section Details
B) Last node points to NULL
C) Nodes point in both directions and form a loop
D) Only odd terms are stored
Answer: C

3. In a singly linked list, insertion at the front requires:


A) tail = new
B) head = head->next
C) new->next = head; head = new
D) Deleting tail first
Answer: C

4. What is a common use of doubly linked lists?


A) Sorting numbers
B) Browser back/forward navigation
C) Recursion
D) Arithmetic operations
Answer: B

5. Which of the following is not true for linked lists?


A) They use dynamic memory
B) They have fixed size
C) They are implemented using nodes
D) They require pointer manipulation
Answer: B
Quickly recap each linked list type and its primary use.
Summing Up (5 min) Clarify confusion between circular and doubly linked structures.
Emphasize pointer management and flexibility of linked lists.
Slow Learners: Provide labeled visual worksheets to fill in node
Follow-up Work fields and trace links.
Advanced Learners: Solve real-world proble

Lesson Plan for: Introduction to Trees

Section Details
1. Understand the basic structure of trees as non-linear data
structures.
Lesson Objectives 2. Learn fundamental properties and uses of trees.
3. Recognize the difference between linear and hierarchical
organization of data.
Lesson Outcomes After the lesson, students will be able to:
Section Details
✔ Define a tree and describe its structure.
✔ Identify real-world examples of tree structures.
✔ Explain key terms: node, root, leaf, edge, level, height.
✔ Distinguish trees from arrays and linked lists.
Real-life analogy-based teaching (family tree, file explorer),
Methods of Pedagogy
diagram tracing, concept-mapping, board activity.
Whiteboard diagrams, slides with tree visuals, animation tools,
Teaching Tools
sample file structure charts.
Ask: “Have you used a file explorer or family tree chart?”
Motivation / Introducing the
Explain how trees help represent hierarchical relationships
Topic (5 min)
unlike lists or arrays.
- What is a Tree?
→ A non-linear data structure composed of nodes connected
by edges
→ One node is designated as the root

- Key Terminology:
→ Node – Element of a tree
→ Root – Topmost node
→ Leaf – Node with no children
→ Edge – Link between two nodes
→ Parent/Child – Relationship based on hierarchy
Content Presentation – Key → Subtree – Any tree formed from a node and its descendants
Points (40 min) → Height – Longest path from root to a leaf

- Types of Trees (Intro Only):


→ General Tree
→ Binary Tree
→ Binary Search Tree (BST)

- Applications:
→ File systems
→ Hierarchical databases
→ HTML/XML DOM
→ Compiler syntax trees
Assessment: MCQs (5 min) Multiple Choice Questions:
1. Which of the following is true about a tree?
A) It’s a linear structure
B) It must contain only integers
C) It has one root and many child nodes
D) All nodes are leaves
Answer: C

2. What do we call a node that has no children?


A) Root
Section Details
B) Parent
C) Leaf
D) Edge
Answer: C

3. What is an edge in a tree?


A) A node with no parent
B) A link between two nodes
C) A node containing data
D) Root of the tree
Answer: B

4. What data structure is best for representing hierarchical


relationships?
A) Array
B) Queue
C) Stack
D) Tree
Answer: D

5. Which node is the topmost node in any tree?


A) Leaf
B) Root
C) Parent
D) Child
Answer: B
Recap key tree terms and their relationships.
Explain the importance of hierarchical organization in
Summing Up (5 min)
applications.
Preview upcoming topics: Binary Trees, Tree Traversals.
Slow Learners: Draw and label a basic tree structure using real-
life data (e.g., a company hierarchy).
Follow-up Work
Advanced Learners: Explore trees in actual file systems (using
terminal or GUI).

Lesson Plan for: Basic Terminologies of Trees

Section Details
1. Introduce essential terms related to tree data structures.
2. Clarify relationships among nodes such as parent, child, and
Lesson Objectives siblings.
3. Build a foundation for understanding advanced tree operations
and types.
Section Details
After the lesson, students will be able to:
✔ Define key terms like node, edge, root, leaf, level, height, and
depth.
Lesson Outcomes ✔ Visualize relationships such as parent-child and ancestor-
descendant.
✔ Identify these elements in given tree diagrams.
✔ Prepare for traversal and tree-building logic.
Tree sketching, guided walkthroughs of node relationships,
Methods of Pedagogy
terminology quizzes, interactive questioning.
Visual slides with example trees, color-coded node diagrams, fill-
Teaching Tools
in-the-blank tree maps, digital animation tools.
Motivation / Introducing the Ask: “What parts make up a family tree or organizational chart?”
Topic (5 min) Connect student answers to root, child, leaf, and edge concepts.
- Essential Terms:

1. Node: Basic unit of a tree containing data.


2. Root: The topmost node, with no parent.
3. Child: A node directly connected below another node.
4. Parent: A node with branches (edges) to one or more children.
5. Siblings: Nodes with the same parent.
6. Leaf: A node with no children.
7. Internal Node: A node with at least one child (non-leaf).
Content Presentation – Key
8. Edge: Connection between parent and child.
Points (40 min)
9. Path: Sequence of edges from one node to another.
10. Level: Distance from the root (root is at level 0).
11. Height: Longest path from the node to a leaf.
12. Depth: Number of edges from root to a specific node.

- Example Practice:
→ Draw a sample tree and ask students to label root, internal
nodes, leaves, levels, etc.
→ Explain height vs. depth visually.
Assessment: MCQs (5 min) Multiple Choice Questions:
1. What is the node at the top of the tree called?
A) Leaf
B) Parent
C) Root
D) Edge
Answer: C

2. Which node has no children?


A) Root
B) Leaf
C) Internal node
D) Parent
Section Details
Answer: B

3. What do you call a node with the same parent as another?


A) Ancestor
B) Root
C) Sibling
D) Child
Answer: C

4. What is an edge in a tree?


A) Node with data
B) Connection between two nodes
C) Root node
D) Leftmost leaf
Answer: B

5. The longest path from a node to a leaf is called:


A) Depth
B) Level
C) Height
D) Distance
Answer: C
Reiterate each term with visual mapping.
Test understanding by asking students to identify these terms in a
Summing Up (5 min)
new tree diagram.
Preview how these terms help in traversal and algorithm design.
Slow Learners: Provide labeled tree diagram worksheets for
matching and color-coding exercises.
Follow-up Work
Advanced Learners: Write pseudocode to compute height,
depth, and total number of leaves in a binary tree.

Lesson Plan for: Representation of Binary Trees – Linear

Section Details
1. Introduce array-based (linear) representation of binary trees.
2. Learn how to calculate the positions of parent, left child, and
Lesson Objectives right child using indices.
3. Understand the advantages and limitations of linear
representation.
Lesson Outcomes After the lesson, students will be able to:
✔ Represent a binary tree using an array.
✔ Compute the index of left child, right child, and parent.
✔ Identify scenarios where linear representation is efficient.
Section Details
✔ Recognize when linked representation is preferred over linear.
Board examples, index-based calculations, dry-run array
Methods of Pedagogy
simulations, class Q&A sessions.
Slides with index-based tree diagrams, whiteboard sketches,
Teaching Tools
sample array tables, guided worksheets.
Motivation / Introducing the Ask: “How would you store a complete binary tree in a simple
Topic (5 min) data structure like an array?”
Lead into using arrays for efficient storage of tree nodes in
memory.
- What is Linear Representation?
→ A method of representing binary trees using arrays.
→ Suitable for complete binary trees.

- Index Formulas (1-based indexing):


→ Root is at index 1
→ Left Child of node at i → 2i

→ Parent of node at i → ⌊i/2⌋


→ Right Child of node at i → 2i + 1

Content Presentation – Key - Example:


Points (40 min) → For tree with nodes A (root), B (left), C (right), D (left of
B), etc.
→ Show how each is placed in array index

- Advantages:
→ Simple storage
→ Fast access using indices

- Limitations:
→ Wasted space for non-complete trees
→ Inflexible when tree structure changes dynamically
Assessment: MCQs (5 min) Multiple Choice Questions:
1. Where is the left child of node at index i (1-based array)?
A) i + 1
B) 2i
C) 2i + 1
D) i - 1
Answer: B

2. What is the parent index of node at position 10?


A) 5
B) 20
C) 2
D) 3
Answer: A
Section Details

3. Linear representation of binary tree is best suited for:


A) Sparse trees
B) Complete binary trees
C) Random trees
D) AVL trees
Answer: B

4. In array representation, where is the root stored (1-based


index)?
A) 0
B) 2
C) 1
D) 10
Answer: C

5. What is a limitation of linear tree representation?


A) Easy to traverse
B) Memory-efficient
C) Wastes space for incomplete trees
D) Used in stacks
Answer: C
Summing Up (5 min) Recap the formulas for parent and child positions in array.
Discuss when linear is better than linked representation.
Preview linked representation for flexible trees.
Slow Learners: Fill-in-the-blank worksheets for index
calculations and tree-to-array mapping.
Follow-up Work
Advanced Learners: Implement a complete binary tree using
array and simulate insertion, deletion.

Lesson Plan for: Representation of Binary Trees – Linked

Section Details
1. Introduce linked representation of binary trees using pointers
or references.
Lesson Objectives 2. Explain the node structure required for binary trees.
3. Compare flexibility and dynamic behavior with linear
representation.
Lesson Outcomes After the lesson, students will be able to:
✔ Define and explain the structure of a node in a binary tree.
✔ Create and connect nodes using left and right pointers.
✔ Build and traverse a binary tree using dynamic memory.
✔ Compare linked and array representations based on flexibility
Section Details
and efficiency.
Diagram explanation, node creation in code, interactive dry-run
Methods of Pedagogy
exercises, live pointer tracing.
Whiteboard pointer diagrams, C/C++/Python code samples,
Teaching Tools
animation tools, node linking flashcards.
Ask: “What if we don’t know the number of elements in the tree
Motivation / Introducing the beforehand?”
Topic (5 min) Introduce linked representation as a flexible, memory-efficient
alternative to arrays.
- What is Linked Representation?
→ A method of storing tree nodes dynamically using pointers
or references.

- Node Structure:
→ Each node contains:
• Data
• Pointer to left child
• Pointer to right child

- Sample Node Definition (C/C++):


Content Presentation – Key struct Node { int data; Node* left; Node* right; };
Points (40 min)
- Tree Construction:
→ Start with root
→ Link child nodes using left and right pointers

- Advantages:
→ Dynamic size
→ Efficient for sparse and unpredictable trees

- Comparison with Linear Representation:


→ Linked: No wasted space
→ Linear: Simpler for complete trees
Assessment: MCQs (5 min) Multiple Choice Questions:
1. What does a node in a linked binary tree contain?
A) Data only
B) Data and one pointer
C) Data, left and right pointers
D) Index and data
Answer: C

2. Which of the following is not true about linked


representation?
A) Dynamic memory usage
B) Can waste space for sparse trees
Section Details
C) Flexible for unknown size
D) Uses pointers
Answer: B

3. What is the pointer in each node of a binary tree used for?


A) Traversal history
B) Random number generation
C) Left and right child reference
D) Array indexing
Answer: C

4. Which data structure is required in linked representation?


A) Stack
B) Queue
C) Node with pointers
D) Matrix
Answer: C

5. Which scenario suits linked representation best?


A) Static, complete trees
B) Sparse trees with dynamic insertion
C) Trees with fixed height
D) Balanced heaps
Answer: B
Recap the node structure with data and pointers.
Highlight memory efficiency and flexibility of linked
Summing Up (5 min)
representation.
Preview binary tree operations (insertion, traversal).
Slow Learners: Build trees using paper nodes and pointer
arrows.
Follow-up Work
Advanced Learners: Implement a binary tree class using linked
representation and perform traversals.

Lesson Plan for: Binary Tree Traversal – In-order

Section Details
1. Understand the logic and steps of in-order traversal in binary
trees.
Lesson Objectives
2. Learn to implement in-order traversal recursively and iteratively.
3. Analyze how in-order traversal is used in binary search trees.
Lesson Outcomes After the lesson, students will be able to:
Section Details
✔ Define and explain the in-order traversal process.
✔ Write in-order traversal code.
✔ Predict output sequences for given trees.
✔ Apply in-order traversal to retrieve sorted data from BSTs.
Visual tree tracing, recursive function dry-runs, side-by-side node
Methods of Pedagogy
visit exercises, coding demonstration.
Whiteboard/tree diagram, sample binary trees, recursive/stack-
Teaching Tools
based code examples, animation tools or simulators.
Ask: “How would you read a dictionary tree-wise so that words are
Motivation / Introducing in order?”
the Topic (5 min) Lead into the idea that in-order traversal produces sorted output in a
BST.
- Definition:
→ Visit Left subtree, then Node, then Right subtree (LNR)

- Recursive Approach:
→ Function calls: inorder(node.left) → visit →
inorder(node.right)
- Iterative Approach:
→ Using a stack to simulate recursion

Content Presentation – Key - Example Tree:


Points (40 min) → Use a simple tree (e.g., 4, 2, 1, 3, 5)
→ Show order: 1 → 2 → 3 → 4 → 5

- Use Case:
→ In a Binary Search Tree, in-order traversal returns nodes in
ascending order.
- Applications:
→ Tree-based sorting
→ Symbol table output
→ Intermediate code generation in compilers
Assessment: MCQs (5 min) Multiple Choice Questions:
1. In in-order traversal, which node is visited first?
A) Root
B) Right
C) Left
D) None
Answer: C

2. In in-order traversal, when is the root visited?


A) First
B) After left subtree
C) After right subtree
D) Last
Section Details
Answer: B

3. What is the result of in-order traversal of a BST?


A) Sorted list
B) Random order
C) Reversed list
D) Depends on data
Answer: A

4. In in-order traversal, what happens after visiting the left subtree?


A) Return to root
B) Visit right subtree directly
C) Terminate
D) Visit leaf only
Answer: A

5. What data structure is used for non-recursive in-order traversal?


A) Queue
B) Heap
C) Stack
D) Graph
Answer: C
Reiterate in-order = LNR.
Summing Up (5 min) Use one tree to show how traversal gives sorted values.
Highlight real-world application in BSTs.
Slow Learners: Use labeled worksheets with boxes for node visit
order.
Follow-up Work
Advanced Learners: Implement both recursive and iterative in-
order traversal and apply it to an expression tree.

Lesson Plan for: Binary Tree Traversal – Pre-order

Section Details
1. Understand the working and sequence of pre-order traversal.
2. Learn recursive and iterative implementation methods.
Lesson Objectives
3. Explore applications like copying trees and prefix expression
generation.
Lesson Outcomes After the lesson, students will be able to:
✔ Define and explain the pre-order traversal process.
✔ Write recursive and stack-based implementations.
✔ Trace node visit sequence in a binary tree.
Section Details
✔ Apply pre-order traversal in tree-based applications.
Diagram tracing, dry-runs, live coding, prefix analogy
Methods of Pedagogy
(grammar/expressions), comparative walkthroughs.
Whiteboard/tree sketch, pointer animations, stack-based traversal
Teaching Tools
demo, recursive function examples (C/Python).
Ask: “How would you read a storybook tree-style, starting from the
Motivation / Introducing
title (root) and then going chapter by chapter?”
the Topic (5 min)
Introduce pre-order as Root → Left → Right traversal.
- Definition:
→ Pre-order traversal visits nodes in the order: Node → Left →
Right (NLR)

- Recursive Implementation:
→ Visit root → Recurse left → Recurse right

- Iterative Implementation:
Content Presentation –
→ Use a stack to simulate recursion
Key Points (40 min)
- Example Tree Walkthrough:
→ Show node visit sequence in a sample binary tree

- Applications:
→ Used to copy/clone a tree
→ Used to generate prefix expressions from expression trees
→ Used in structured data export (like JSON/XML)
Assessment: MCQs (5 Multiple Choice Questions:
min) 1. What is the first node visited in pre-order traversal?
A) Left
B) Root
C) Right
D) Leaf
Answer: B

2. What is the correct order for pre-order traversal?


A) Left → Root → Right
B) Root → Left → Right
C) Left → Right → Root
D) Right → Left → Root
Answer: B

3. Pre-order traversal is used for:


A) Sorting arrays
B) Finding height
C) Copying a tree
D) Balancing trees
Section Details
Answer: C

4. What data structure is used in iterative pre-order traversal?


A) Queue
B) Stack
C) Heap
D) Tree
Answer: B

5. What is the output of pre-order traversal on the tree with nodes: A


(root), B (left), C (right)?
A) B A C
B) A B C
C) C B A
D) B C A
Answer: B
Recap the NLR pattern for pre-order.
Compare with in-order/post-order briefly.
Summing Up (5 min)
Highlight real use in tree duplication and prefix expression
generation.
Follow-up Work Slow Learners: Provide node-labeled worksheets for tracing.
Advanced Learners: Implement pre-order traversal both recursively
and iteratively for an expression tree and print prefix notation.

Lesson Plan for: Binary Tree Traversal – Post-order

Section Details
1. Understand the logic and steps of post-order traversal.
2. Learn recursive and iterative implementations.
Lesson Objectives
3. Explore use cases such as deleting trees and generating postfix
expressions.
After the lesson, students will be able to:
✔ Define and explain the post-order traversal sequence.
✔ Write post-order traversal using recursion and stack.
Lesson Outcomes
✔ Apply post-order to real applications like postfix generation and
tree deletion.
✔ Trace node visit order accurately.
Dry-run examples, diagram annotation, recursive walkthroughs, live
Methods of Pedagogy
demonstrations, coding activity.
Tree diagrams on board/slides, code examples in C/Python, visual
Teaching Tools
animation tools, post-order traversal tables.
Motivation / Introducing Ask: “When cleaning a room, don’t you finish the inner sections first
the Topic (5 min) before exiting?”
Section Details
Introduce post-order as: Left → Right → Root, similar to cleaning
up or deleting from leaves upward.
- Definition:
→ Post-order traversal visits nodes in the order: Left → Right →
Root (LRN)

- Recursive Implementation:
→ Visit left → right → node

- Iterative Implementation:
Content Presentation – → Use two stacks or a modified stack strategy
Key Points (40 min)
- Example Trace:
→ Apply post-order to a sample tree (e.g., A, B, C with B and C
as children of A)

- Applications:
→ Tree deletion (frees memory from leaves to root)
→ Postfix expression generation in expression trees
→ Used in compilers and syntax tree evaluation
Assessment: MCQs (5 Multiple Choice Questions:
min) 1. What is the correct sequence for post-order traversal?
A) Root → Left → Right
B) Left → Root → Right
C) Left → Right → Root
D) Right → Left → Root
Answer: C

2. Which traversal visits root last?


A) In-order
B) Pre-order
C) Post-order
D) Level-order
Answer: C

3. Post-order is useful for:


A) Sorting data
B) Finding max value
C) Tree deletion
D) Copying tree
Answer: C

4. Which data structure can be used for non-recursive post-order


traversal?
A) Queue
Section Details
B) Heap
C) Two stacks
D) Priority queue
Answer: C

5. In post-order, when is the root node visited?


A) First
B) After left subtree
C) After right subtree
D) At the end
Answer: D
Recap the Left → Right → Root (LRN) pattern.
Compare it with in-order and pre-order.
Summing Up (5 min)
Discuss how post-order is ideal for cleanup, postfix conversion, and
tree evaluation.
Slow Learners: Use labeled tree diagrams and walkthrough cards to
trace post-order.
Follow-up Work
Advanced Learners: Write iterative post-order traversal with two
stacks and apply it to an expression tree to evaluate the postfix result.

Lesson Plan for: Specialized Trees – Expression Trees

Section Details
1. Understand the concept of expression trees and their construction.
2. Learn how to represent and evaluate arithmetic expressions using
Lesson Objectives binary trees.
3. Apply tree traversals to generate infix, prefix, and postfix
expressions.
After the lesson, students will be able to:
✔ Define expression trees and explain their structure.
✔ Construct an expression tree from postfix input.
Lesson Outcomes
✔ Use tree traversals to obtain equivalent infix, prefix, and postfix
expressions.
✔ Evaluate expression trees using post-order traversal.
Step-by-step tree building, whiteboard tracing, expression
Methods of Pedagogy
evaluation using stack simulation, prefix-postfix-infix comparisons.
Sample arithmetic expressions, postfix-to-tree animation, slide
Teaching Tools
diagrams, C/Python expression tree evaluation code.
Ask: “How does a calculator understand and evaluate 3 + 5 * 2?”
Motivation / Introducing
Lead into how expressions are stored as trees and evaluated
the Topic (5 min)
systematically.
Content Presentation – - What is an Expression Tree?:
Section Details
→ A binary tree where internal nodes are operators (+, –, *, /),
and leaves are operands (numbers/variables).

- Building an Expression Tree from Postfix Expression:


→ Use stack to store nodes.
→ On operand: create node and push.
→ On operator: pop two nodes, create new node as root, attach
them as left and right.
Key Points (40 min)
- Traversals and Expression Forms:
→ In-order = Infix
→ Pre-order = Prefix
→ Post-order = Postfix

- Evaluation:
→ Use post-order traversal to evaluate the expression.
- Applications:
→ Compilers, calculators, interpreters, syntax trees
Assessment: MCQs (5 Multiple Choice Questions:
min) 1. In an expression tree, what are the leaf nodes?
A) Operators
B) Parentheses
C) Operands
D) Roots
Answer: C

2. Which traversal gives the postfix form of an expression tree?


A) In-order
B) Pre-order
C) Post-order
D) Level-order
Answer: C

3. What is the root node in the expression tree for "A + B * C"?
A) +
B) *
C) A
D) Cannot determine
Answer: A

4. What data structure is used to build an expression tree from


postfix?
A) Queue
B) Stack
C) Linked list
Section Details
D) Heap
Answer: B

5. In expression trees, which traversal is used to evaluate the result


of the expression?
A) Pre-order
B) In-order
C) Post-order
D) Breadth-first
Answer: C
Recap expression tree building from postfix.
Summing Up (5 min) Demonstrate traversal-to-expression mapping.
Explain real use in interpreters and compilers.
Slow Learners: Use step cards and diagrams to simulate expression
tree construction and traversal.
Follow-up Work
Advanced Learners: Build a full expression tree parser in code and
evaluate arithmetic expressions using recursion.

Lesson Plan for: Introduction to Binary Search Trees (BST)

Section Details
1. Introduce the structure and properties of Binary Search Trees.
Lesson Objectives 2. Understand the rule for inserting and organizing nodes in a BST.
3. Learn the benefits of BSTs in searching and sorting.
After the lesson, students will be able to:
✔ Define a Binary Search Tree and explain its properties.
Lesson Outcomes ✔ Construct a BST from a sequence of values.
✔ Search, insert, and trace node positions in a BST.
✔ Identify real-world use cases of BSTs.
Tree diagram illustration, guided insertion/search activities, coding
Methods of Pedagogy
walkthroughs, comparison with linear data structures.
Visual slides, whiteboard examples, value-card sorting, animation
Teaching Tools
tools, BST-building exercises in C/Python.
Ask: “If I gave you a phonebook, would you start at page one or go
Motivation / Introducing straight to the middle?”
the Topic (5 min) Introduce BST as a sorted, hierarchical structure that reduces
search time.
Content Presentation – Key - Definition:
Points (40 min) → A binary tree where for each node:
• Left child < parent
• Right child > parent
Section Details

- Basic Operations:
→ Insertion – Compare and place left or right recursively
→ Searching – Use the binary nature to skip half of nodes
→ Traversal – In-order returns sorted list

- BST Construction:
→ Step-by-step insertion of values like 50, 30, 20, 40, 70, 60, 80

- Properties:
→ Height affects efficiency
→ Balanced BSTs have better performance (O(log n))

- Applications:
→ Searching (faster than linear list)
→ Dynamic sets, dictionaries, symbol tables
Assessment: MCQs (5 min) Multiple Choice Questions:
1. In a BST, where are values smaller than the root placed?
A) Right subtree
B) Left subtree
C) Root itself
D) Nowhere
Answer: B

2. What is the result of in-order traversal on a BST?


A) Reverse sorted
B) Unsorted
C) Sorted
D) Pre-order output
Answer: C

3. Which operation benefits most from the BST property?


A) Traversal
B) Display
C) Search
D) Print
Answer: C

4. If a node has value 45 and its right child is 40, what does this
indicate?
A) Valid BST
B) Balanced tree
C) Invalid BST
D) Heap
Answer: C
Section Details

5. Which data structure has O(log n) average case for search and
insertion?
A) Stack
B) Linked List
C) BST
D) Queue
Answer: C
Recap the structure and rules of BST.
Emphasize search, insert efficiency.
Summing Up (5 min)
Show how in-order traversal produces sorted data.
Compare with linear list for large datasets.
Slow Learners: Use labeled cards to construct BSTs manually.
Follow-up Work Advanced Learners: Write BST insert/search functions and test
with user input or random data.

Lesson Plan for: Operations on Binary Search Trees – Insertion

Section Details
1. Understand the rules for inserting nodes into a Binary Search
Tree (BST).
Lesson Objectives
2. Learn the recursive and iterative approaches to BST insertion.
3. Analyze the effect of insertion order on the shape of the tree.
After the lesson, students will be able to:
✔ Explain the insertion logic based on BST properties.
Lesson Outcomes ✔ Insert values into a BST correctly.
✔ Write recursive and non-recursive insertion code.
✔ Identify how insertion affects balance and depth.
Step-by-step dry-run, interactive tree building, whiteboard tracing,
Methods of Pedagogy
code demo (recursive vs. iterative).
Whiteboard/tree diagrams, value cards, recursion visualization
Teaching Tools
tools, live code (C/Python), animation tools.
Ask: “What happens if you insert a new contact into a sorted
Motivation / Introducing the phonebook?”
Topic (5 min) Relate this to BST’s logic of placing smaller/larger values in
correct subtrees.
Content Presentation – Key - BST Insertion Rule:
Points (40 min) → If value < current node → insert left
→ If value > current node → insert right
→ Continue until NULL position is found

- Recursive Insertion:
Section Details
→ Call function with root, compare value, insert recursively

- Iterative Insertion:
→ Use loop to traverse and find correct position

- Example Walkthrough:
→ Insert sequence: 50, 30, 70, 20, 40, 60, 80
→ Build tree node-by-node and show structure

- Observation:
→ Insertion order affects balance
→ Skewed BSTs have poor performance (O(n))

- Applications:
→ Dynamic datasets (contact lists, dictionaries)
→ Real-time indexing
Assessment: MCQs (5 min) Multiple Choice Questions:
1. Where is a new value placed if it is greater than the current
node?
A) Left subtree
B) Root
C) Right subtree
D) Deleted
Answer: C

2. What is the time complexity of insertion in a balanced BST?


A) O(n)
B) O(log n)
C) O(1)
D) O(n²)
Answer: B

3. What happens when you insert a value already present in BST?


A) Error
B) Duplicate node is created
C) Nothing happens (often ignored)
D) Replaces root
Answer: C

4. In a recursive insertion, when do we create a new node?


A) When root is NULL
B) When root is not NULL
C) When node is leaf
D) Always
Answer: A
Section Details

5. Which type of BST is formed by inserting sorted values like 10,


20, 30, 40?
A) Complete
B) Balanced
C) Skewed
D) Heap
Answer: C
Recap insertion process and the importance of placement logic.
Draw connections to search and traversal.
Summing Up (5 min)
Discuss real-world implications of unbalanced vs. balanced
insertions.
Slow Learners: Practice with manual card-based BST building.
Follow-up Work Advanced Learners: Implement both recursive and iterative
insertion functions, test with random and sorted input.

Lesson Plan for: Operations on Binary Search Trees – Deletion

Section Details
1. Understand the process of deleting nodes in a Binary Search Tree
(BST).
Lesson Objectives
2. Learn the three cases of deletion (leaf, one child, two children).
3. Apply deletion logic while maintaining BST properties.
After the lesson, students will be able to:
✔ Identify and handle all three deletion cases.
Lesson Outcomes ✔ Modify a BST while preserving order and structure.
✔ Write a complete deletion function in code.
✔ Analyze the impact of deletion on tree balance.
Tree diagram tracing, step-by-step deletion dry-runs, code simulation
Methods of Pedagogy (C/Python), use of real-world analogies (e.g., removing family
members from a family tree).
Whiteboard diagrams, animation software, pseudocode comparison,
Teaching Tools
step-by-step coding in class, example-based deletion sequences.
Ask: “How would you remove a name from a phonebook while
Motivation /
keeping it in alphabetical order?”
Introducing the Topic
Introduce BST deletion as a method of removing while maintaining
(5 min)
order.
Content Presentation – - Deletion in BST – 3 Cases:
Key Points (40 min)
Case 1: Node is a leaf
→ Simply remove the node
Section Details

Case 2: Node has one child


→ Link parent to the child directly

Case 3: Node has two children


→ Find the inorder successor (smallest in right subtree)
→ Replace node’s data with successor’s data
→ Delete successor node

- Example Walkthrough:
→ Deletion in a tree with nodes: 50, 30, 70, 20, 40, 60, 80
→ Delete 20 (leaf), then 30 (one child), then 50 (two children)

- Code Implementation:
→ Recursive deletion function
→ Proper return of root after deletion

- Applications:
→ Dynamic datasets (e.g., deletion in contact management,
indexing)
Assessment: MCQs (5 Multiple Choice Questions:
min) 1. What is the first step when deleting a node with two children?
A) Delete it directly
B) Replace with left child
C) Find inorder successor
D) Set it to NULL
Answer: C

2. What is the inorder successor of a node?


A) Parent node
B) Largest in left subtree
C) Smallest in right subtree
D) Deepest node
Answer: C

3. In case of deleting a leaf node, what changes in the tree?


A) Tree is rebalanced
B) Only one pointer is updated
C) Entire tree is updated
D) Subtree is copied
Answer: B

4. What is the time complexity of deletion in a balanced BST?


A) O(n²)
B) O(1)
Section Details
C) O(log n)
D) O(n)
Answer: C

5. Which of the following must be preserved after deletion in BST?


A) Tree height
B) BST property (left < root < right)
C) Number of nodes
D) Memory address
Answer: B
Recap all three deletion cases: leaf, one child, two children.
Summing Up (5 min) Show how to maintain BST structure.
Discuss the role of inorder successor and practical applications.
Slow Learners: Use hands-on cards for tracing deletion cases.
Follow-up Work Advanced Learners: Implement full deletion logic and visualize
changes in tree structure dynamically.

Lesson Plan for: Advanced Trees – Splay Trees

Section Details
1. Introduce the concept of splay trees as self-adjusting binary search
trees.
Lesson Objectives 2. Understand the motivation behind splaying and its role in
optimizing repeated access.
3. Learn the basic structure and working of splay trees.
After the lesson, students will be able to:
✔ Define a splay tree and explain how it works.
Lesson Outcomes ✔ Describe scenarios where splay trees outperform standard BSTs.
✔ Distinguish between standard BST and splay tree behavior.
✔ Recognize the use of splaying to reduce future access time.
Visual explanation through tree animations, real-world analogies
Methods of Pedagogy (recently used list), step-by-step transformation examples, coding
previews.
Slide deck with tree diagrams, whiteboard sketches, stackable node
Teaching Tools blocks, simple splay code (Python/C++), performance comparison
graphs.
Ask: “Why do the apps you use most show up first on your home
Motivation / Introducing screen?”
the Topic (5 min) Introduce splay trees as a structure that moves frequently accessed
data to the top—just like your device adapts to you.
Content Presentation – - What is a Splay Tree?
Section Details
→ A binary search tree that self-adjusts after every operation
(search, insert, delete)
→ The accessed node is moved to the root

- Key Concept: Splaying


→ A series of rotations to bring a node to the root
→ Helps improve future access speed to that node

- Why Use Splay Trees?


→ Good performance for non-uniform access patterns
→ Amortized cost per operation is O(log n)
Key Points (40 min)
- Comparison to Other Trees:
→ Static BST: Access time depends on height
→ AVL Tree: Maintains balance
→ Splay Tree: Adapts based on usage

- Common Operations:
→ Search
→ Insert
→ Delete
→ All include splaying
Assessment: MCQs (5 Multiple Choice Questions:
min) 1. What type of binary tree is a splay tree?
A) Balanced AVL Tree
B) Randomized BST
C) Self-adjusting BST
D) Binary Heap
Answer: C

2. What is the primary feature of a splay tree?


A) Maintains perfect balance
B) Uses fixed height
C) Moves accessed node to root
D) Has a parent pointer in every node
Answer: C

3. What is the average time complexity of operations in a splay tree?


A) O(n)
B) O(log n)
C) O(n log n)
D) O(1)
Answer: B

4. Which real-world application suits splay trees best?


Section Details
A) Static databases
B) Sorting
C) Recently-used cache
D) Linear memory allocation
Answer: C

5. What is a drawback of splay trees?


A) Cannot be implemented in C
B) Always perfectly balanced
C) Poor performance for uniform access
D) Cannot handle insertion
Answer: C
Recap splay tree definition and how it helps prioritize recent
accesses.
Summing Up (5 min)
Emphasize where splay trees shine vs. other BSTs.
Point to real applications: caches, interpreters, UI optimizations.
Slow Learners: Use guided card-based activities to simulate
splaying manually.
Follow-up Work
Advanced Learners: Implement a basic splay tree and test with
frequently accessed data patterns.

Lesson Plan for: The Splaying Operation

Section Details
1. Understand the splaying operation used in splay trees.
2. Learn the different rotation cases: Zig, Zig-Zig, Zig-Zag.
Lesson Objectives
3. Apply rotations to bring a node to the root during access, insert, or
delete.
After the lesson, students will be able to:
✔ Define the concept of splaying.
Lesson Outcomes ✔ Identify which rotation to apply (zig, zig-zig, zig-zag).
✔ Perform splaying through step-by-step rotations.
✔ Maintain tree structure and BST properties during splaying.
Visual tree tracing, dry-run node movement, hands-on rotations
Methods of Pedagogy
using diagrams, real-time animation walkthroughs.
Slide deck with rotation diagrams, whiteboard trees, stackable nodes
Teaching Tools
(cards/props), animation software or Python-based splay simulators.
Ask: “How do you bubble up your favorite app to your home screen
Motivation / Introducing after you use it frequently?”
the Topic (5 min) Explain that splaying is the act of “bringing an accessed node to the
root” through a series of rotations.
Section Details
- What is Splaying?
→ An operation in splay trees to move a node to the root.

- Why Splay?
→ Improves access time for frequently used nodes
→ Keeps recently used data near the root

- Splaying Cases:

1. Zig (Single Rotation):


→ Node is child of root
→ Left or right single rotation
Content Presentation –
Key Points (40 min) 2. Zig-Zig (Double Rotation):
→ Node and parent are both left-left or right-right children
→ Rotate parent, then grandparent

3. Zig-Zag (Double Rotation):


→ Node is left child of right child or right child of left child
→ Rotate node with parent, then with grandparent

- Examples for Each Case:


→ Use tree diagrams with labeled nodes (X, P, G)

- When is Splaying Done?


→ After search, insert, or delete
Assessment: MCQs (5 Multiple Choice Questions:
min) 1. What is the purpose of splaying in a splay tree?
A) Delete the root
B) Balance the tree perfectly
C) Bring a node to the root
D) Convert to AVL
Answer: C

2. Which splaying case uses only one rotation?


A) Zig
B) Zig-Zig
C) Zig-Zag
D) All cases
Answer: A

3. In Zig-Zig, how are the node and its parent positioned?


A) Opposite sides
B) Same side (LL or RR)
C) Randomly
Section Details
D) Parent is root
Answer: B

4. Which operation is not followed by splaying?


A) Search
B) Insert
C) Delete
D) Traversal
Answer: D

5. Zig-Zag splaying involves:


A) One rotation
B) Rotating only the grandparent
C) Two rotations in opposite directions
D) No change
Answer: C
Recap the purpose of splaying and its three cases.
Summing Up (5 min) Compare single and double rotations.
Highlight its use in keeping access efficient over time.
Slow Learners: Provide handout with blank tree diagrams for step-
by-step splaying practice.
Follow-up Work
Advanced Learners: Implement a function for splaying with Zig,
Zig-Zig, Zig-Zag logic and test with randomized node access.

Lesson Plan for: Tree Concepts Review and Problem Solving

Section Details
1. Recap all major tree concepts covered (basic trees, binary trees,
BST, traversal, expression trees, advanced trees).
Lesson Objectives 2. Reinforce understanding through a variety of conceptual and
coding problems.
3. Prepare students for application-based assessments.
After the lesson, students will be able to:
✔ Identify and distinguish between different tree types.
Lesson Outcomes ✔ Apply traversal techniques to solve problems.
✔ Implement tree operations such as insertion, deletion, and search.
✔ Analyze time and space complexity in tree-based problems.
Concept review through questioning, board-level practice problems,
Methods of Pedagogy
group coding tasks, MCQ quiz, pair programming.
Recap chart, tree construction exercises, coding IDE (C/Python),
Teaching Tools
MCQ quiz flashcards, error-debugging examples.
Section Details
Ask: “Which tree operation did you find most useful or most
Motivation / Introducing confusing?”
the Topic (5 min) Let students recall key topics and transitions (basic → binary →
BST → expression/splay).
- Tree Types Overview:
→ General Tree
→ Binary Tree
→ BST
→ Expression Tree
→ Splay Tree

- Key Concepts Recap:


→ Tree Terminology
→ Tree Traversals (In-order, Pre-order, Post-order)
Content Presentation – → BST insertion/deletion
Key Points (40 min) → Expression evaluation
→ Splaying and rotations

- Problem Solving Practice:


→ Construct a tree from preorder and inorder
→ Write a function to delete a node in a BST
→ Convert postfix to expression tree and evaluate
→ Identify splay tree rotations from access pattern

- Debug Practice:
→ Identify and correct errors in tree operation code
Assessment: MCQs (5 min) Multiple Choice Questions:
1. Which traversal is used to retrieve sorted data from a BST?
A) Pre-order
B) Post-order
C) In-order
D) Level-order
Answer: C

2. In which case does a splay tree perform a Zig-Zag rotation?


A) Root node
B) Parent and child on same side
C) Parent and child on opposite sides
D) No rotation
Answer: C

3. What is the time complexity of searching in a balanced BST?


A) O(1)
B) O(log n)
C) O(n)
Section Details
D) O(n²)
Answer: B

4. What structure does an expression tree represent?


A) Syntax tree
B) Traversal tree
C) Heap
D) Queue
Answer: A

5. What is the primary feature of a binary tree?


A) Maximum of 3 children
B) Nodes linked as graphs
C) Maximum of 2 children
D) Only leaf nodes
Answer: C
Reinforce distinctions between tree types.
Summing Up (5 min) Discuss importance of traversals, BST logic, and splaying.
Share tips for coding tree-based problems (e.g., recursive patterns).
Slow Learners: Provide worksheet with fill-in-the-blank tree
diagrams and pseudocode.
Follow-up Work
Advanced Learners: Solve LeetCode/Codeforces problems
involving BST, expression trees, and splaying operations.

UNIT 4
Lesson Plan for: Introduction to Sorting

Section Details
Lesson Objectives 1. Understand the concept and importance of sorting in computer
science.
2. Learn the classification of sorting algorithms.
Section Details
3. Identify key characteristics such as time complexity, stability, and
space efficiency.
After the lesson, students will be able to:
✔ Define sorting and explain its necessity in programming.
✔ Classify sorting algorithms based on methodology and
Lesson Outcomes performance.
✔ Compare basic sorting types like comparison-based and non-
comparison-based.
✔ Interpret when and where to use different sorting techniques.
Analogy-based teaching (arranging books, height-wise sorting),
Methods of Pedagogy
flow diagrams, comparative charts, real-world examples.
Slide deck, board illustrations, visual sort simulators (for bubble,
Teaching Tools
selection), paper sorting game, complexity chart.
Ask: “How do you organize names alphabetically or arrange
Motivation / Introducing numbers from smallest to largest?”
the Topic (5 min) Introduce sorting as an essential operation in searching,
optimization, and data organization.
- What is Sorting?
→ Rearranging data in a particular order (ascending/descending)

- Why Sorting is Important?


→ Easier searching, comparison, reporting, visualization

- Classification of Sorting Algorithms:


1. Based on Technique:
→ Comparison-based: Bubble, Selection, Insertion, Merge, Quick
Content Presentation –
→ Non-comparison-based: Counting, Radix
Key Points (40 min)
2. Based on Stability:
→ Stable vs. Unstable sorting

3. Based on Time Complexity:


→ Best, Worst, Average case analysis

- Real-Life Examples:
→ Arranging marks, contact lists, airline ticket prices
Assessment: MCQs (5 Multiple Choice Questions:
min) 1. What is sorting in data structures?
A) Deleting elements
B) Rearranging elements in order
C) Adding new data
D) Splitting arrays
Answer: B

2. Which of the following is a comparison-based sorting algorithm?


Section Details
A) Counting Sort
B) Radix Sort
C) Merge Sort
D) Hashing
Answer: C

3. Which sorting technique is not comparison-based?


A) Quick Sort
B) Bubble Sort
C) Radix Sort
D) Insertion Sort
Answer: C

4. Why is sorting important before binary search?


A) Reduces time
B) Required for it to work
C) It’s a rule
D) Saves memory
Answer: B

5. What do we call a sorting algorithm that maintains the relative


order of equal elements?
A) Stable sort
B) Quick sort
C) Fast sort
D) Heap sort
Answer: A
Recap what sorting is and its real-world significance.
Summing Up (5 min) Summarize types and give a preview of specific algorithms (Bubble,
Selection, Merge, Quick).
Slow Learners: Use hands-on activities like sorting numbers on
paper cards.
Follow-up Work
Advanced Learners: Compare the time complexities of various
sorting algorithms on different inputs.

Lesson Plan for: Bubble Sort

Section Details
1. Understand the working of the Bubble Sort algorithm.
2. Learn how to compare and swap adjacent elements to sort a
Lesson Objectives
list.
3. Analyze the efficiency and limitations of Bubble Sort.
Lesson Outcomes After the lesson, students will be able to:
Section Details
✔ Explain the step-by-step process of Bubble Sort.
✔ Implement Bubble Sort using nested loops.
✔ Analyze its time complexity in best, worst, and average cases.
✔ Identify scenarios where Bubble Sort is not optimal.
Hands-on card sorting activity, dry-run on board, code
Methods of Pedagogy
demonstration, visual animation of passes and swaps.
Slides with illustrations, sorting animation tools, C/Python code,
Teaching Tools
board work for step-by-step iterations.
Ask: “If you had to sort numbers on paper by comparing two at a
Motivation / Introducing the time, how would you do it?”
Topic (5 min) Introduce Bubble Sort as a basic but intuitive comparison-based
algorithm.
- Definition of Bubble Sort:
→ Repeatedly steps through the list
→ Compares adjacent elements and swaps them if in wrong
order
→ Process repeats until no swaps are needed

- Step-by-Step Example:
→ Sort: [5, 2, 9, 1]
→ After each pass: [2, 5, 1, 9] → [2, 1, 5, 9] → [1, 2, 5, 9]

- Algorithm:
Content Presentation – Key for i in range(n):
Points (40 min) for j in range(n-i-1):
if arr[j] > arr[j+1]: swap

- Time Complexity:
→ Best: O(n) (if already sorted)
→ Average & Worst: O(n²)

- Space Complexity: O(1)

- Applications & Limitations:


→ Simple but inefficient for large datasets
→ Useful for teaching and small datasets
Assessment: MCQs (5 min) Multiple Choice Questions:
1. What does Bubble Sort do?
A) Deletes elements
B) Finds maximum element
C) Repeatedly compares and swaps adjacent elements
D) Uses divide and conquer
Answer: C

2. What is the worst-case time complexity of Bubble Sort?


Section Details
A) O(n)
B) O(log n)
C) O(n log n)
D) O(n²)
Answer: D

3. When does Bubble Sort perform best?


A) When array is reversed
B) When array is sorted
C) When array has duplicates
D) When array is empty
Answer: B

4. What is the space complexity of Bubble Sort?


A) O(n)
B) O(log n)
C) O(n²)
D) O(1)
Answer: D

5. Which of the following is a drawback of Bubble Sort?


A) Uses recursion
B) Complex implementation
C) Slow for large lists D) Uses extra memory
Answer: C
Recap the logic: compare → swap → repeat until sorted.
Explain why it’s not used in practice for big data.
Summing Up (5 min)
Introduce more efficient sorts coming next (e.g., Insertion,
Quick).
Slow Learners: Practice with number cards, manually
performing each pass.
Follow-up Work
Advanced Learners: Optimize Bubble Sort with a flag to break
early when sorted.

Lesson Plan for: Insertion Sort

Section Details
1. Understand how the Insertion Sort algorithm works.
2. Learn to sort a list by placing each element into its correct
Lesson Objectives position in the sorted part.
3. Analyze its efficiency and compare with Bubble and Selection
Sort.
Lesson Outcomes After the lesson, students will be able to:
Section Details
✔ Describe the logic of Insertion Sort.
✔ Implement Insertion Sort using iterative loops.
✔ Analyze best, worst, and average case complexities.
✔ Identify when Insertion Sort is better suited than other basic
sorts.
Step-by-step element insertion demo, real-time coding, whiteboard
Methods of Pedagogy
tracing, compare-pass analysis.
Board walkthroughs, code editors (Python/C), card-based sorting
Teaching Tools
activity, slides with animations.
Ask: “How do you sort playing cards in your hand?”
Motivation / Introducing
Connect that real-life strategy to Insertion Sort—placing each new
the Topic (5 min)
item into the correct position in an already sorted hand.
- What is Insertion Sort?
→ Sorts elements by picking one element at a time and inserting
it into its correct position

- Algorithm Steps:
for i in range(1, n):
key = arr[i]
j = i - 1
while j >= 0 and arr[j] > key:
arr[j+1] = arr[j]
j -= 1
arr[j+1] = key

- Example:
Content Presentation – Key
Input: [8, 5, 2, 9]
Points (40 min)
Step-by-step build: [5, 8], then [2, 5, 8], then [2, 5, 8, 9]

- Time Complexity:
• Best: O(n) (already sorted)
• Average/Worst: O(n²)

- Space Complexity: O(1)

- Advantages:
• Simple
• Efficient for small/partially sorted data

- Drawbacks:
• Inefficient on large datasets
Assessment: MCQs (5 min) Multiple Choice Questions:
1. In Insertion Sort, where is each element placed?
A) Randomly
B) At the end
Section Details
C) In correct position in the sorted part
D) In a queue
Answer: C

2. What is the time complexity of Insertion Sort in the best case?


A) O(n)
B) O(n²)
C) O(log n)
D) O(1)
Answer: A

3. Which sorting method is similar to sorting cards in hand?


A) Merge Sort
B) Bubble Sort
C) Insertion Sort
D) Selection Sort
Answer: C

4. What is the space complexity of Insertion Sort?


A) O(n)
B) O(1)
C) O(log n)
D) O(n²)
Answer: B

5. When is Insertion Sort preferred?


A) For large, unsorted datasets
B) When memory is limited and data is almost sorted
C) When elements are equal
D) When using binary search
Answer: B
Summing Up (5 min) Recap Insertion Sort as placing each item where it fits.
Compare with Bubble and Selection Sort for clarity.
Emphasize its role in hybrid sorting algorithms (like Timsort).
Follow-up Work Slow Learners: Use physical playing cards to simulate sort.
Advanced Learners: Analyze the number of shifts in different
cases and implement binary insertion sort.

Lesson Plan for: Selection Sort


Section Details
1. Understand how Selection Sort works by selecting the minimum
element.
2. Learn how to perform sorting by repeated selection and
Lesson Objectives
swapping.
3. Analyze time complexity and compare with other basic sorting
techniques.
After the lesson, students will be able to:
✔ Describe the logic of Selection Sort.
Lesson Outcomes ✔ Implement the algorithm using loops.
✔ Determine time complexity in different cases.
✔ Compare with Insertion and Bubble Sort.
Visual pass-by-pass example on board, live coding demo, dry-run
Methods of Pedagogy
worksheets, sorting animation.
Slides with diagrams, pseudocode walkthrough, C/Python code
Teaching Tools
samples, whiteboard sorting simulation.
Ask: “If you had to pick the smallest number in a list to start
Motivation / Introducing sorting, what would you do?”
the Topic (5 min) Introduce Selection Sort as the method of repeatedly selecting the
minimum and placing it in the correct position.
- What is Selection Sort?
→ A comparison-based sorting algorithm
→ Repeatedly finds the minimum element from unsorted part
and moves it to the beginning

- Steps:
for i in range(0, n-1):
min_idx = i
for j in range(i+1, n):
if arr[j] < arr[min_idx]: min_idx = j
swap arr[i] and arr[min_idx]

Content Presentation – Key


- Example:
Points (40 min)
Array: [29, 10, 14, 37, 13]
After Pass 1: [10, 29, 14, 37, 13]
After Pass 2: [10, 13, 14, 37, 29] ...

- Time Complexity:
• Best, Average, Worst: O(n²)

- Space Complexity: O(1)

- Key Features:
• Always makes (n-1) swaps
• Not stable (can change relative order of equal elements)
Assessment: MCQs (5 min) Multiple Choice Questions:
Section Details
1. What is the basic idea of Selection Sort?
A) Swapping every adjacent pair
B) Dividing list in halves
C) Finding min and placing it in position
D) Using a pivot
Answer: C

2. How many swaps are performed in Selection Sort (worst case)?


A) O(n²)
B) O(log n)
C) O(1)
D) O(n)
Answer: D

3. What is the time complexity of Selection Sort in best case?


A) O(n)
B) O(log n)
C) O(n²)
D) O(n log n)
Answer: C

4. Selection Sort is:


A) Recursive
B) Not in-place
C) Non-comparison based
D) In-place
Answer: D

5. Which of the following is a drawback of Selection Sort?


A) Too many swaps
B) Requires extra space
C) Inefficient on large lists
D) Complex to implement
Answer: C
Recap: Selection Sort works by selecting the minimum and
placing it in order.
Summing Up (5 min)
Highlight how it differs from Bubble and Insertion.
Mention why it's not used for large datasets.
Slow Learners: Practice with card sorting games to simulate
minimum selection.
Follow-up Work
Advanced Learners: Compare the number of comparisons and
swaps with Insertion Sort on same input.
Lesson Plan for: Comparing Basic Sorts & Introduction to Shell Sort

Section Details
1. Review and compare Bubble, Insertion, and Selection Sort
algorithms.
Lesson Objectives 2. Identify their strengths, weaknesses, and appropriate use cases.
3. Introduce Shell Sort as an improved version of Insertion Sort
for better performance on larger datasets.
After the lesson, students will be able to:
✔ Compare basic sorting algorithms based on time, space, and
stability.
Lesson Outcomes ✔ Identify when to use which sort for a given dataset.
✔ Describe the concept of Shell Sort and how it improves upon
Insertion Sort.
✔ Perform basic dry-runs of Shell Sort using gaps.
Comparative table creation, flowchart mapping, code
Methods of Pedagogy
walkthrough, animated Shell Sort demonstration.
Comparison chart, sorting animations, real-time coding
Teaching Tools
(Python/C), visual dry-run sheets.
Ask: “Which sorting technique would you choose for a list of
Motivation / Introducing the 1,000 items? Why not Bubble Sort?”
Topic (5 min) Use this to motivate the need for more efficient sorting
methods like Shell Sort.
- Comparison of Basic Sorts:

Bubble Sort:
• O(n²) worst case
• Stable, simple
• Poor for large inputs

Content Presentation – Key Insertion Sort:


Points (40 min) • O(n) best case
• Good for nearly sorted data

Selection Sort:
• O(n²) always
• Fewest swaps

- Comparison Table:
Assessment: MCQs (5 min) Multiple Choice Questions:
1. Which of the following is the most efficient among basic sorts
for large data?
A) Bubble Sort
B) Insertion Sort
C) Selection Sort
Section Details
D) None of these
Answer: D

2. Which sort uses a “gap” to reduce the number of comparisons


early?
A) Insertion Sort
B) Shell Sort
C) Selection Sort
D) Quick Sort
Answer: B

3. Which sorting method is most suitable for data that's already


almost sorted?
A) Selection
B) Insertion
C) Shell
D) Merge
Answer: B

4. What happens to the gap in Shell Sort over time?


A) Increases
B) Doubles
C) Stays constant
D) Reduces
Answer: D

5. Which basic sort performs the least number of swaps?


A) Bubble
B) Insertion
C) Selection
D) Shell
Answer: C
Recap the differences among Bubble, Insertion, and Selection
Sort.
Summing Up (5 min) Highlight how Shell Sort builds on Insertion by using a gap
strategy.
Preview next: advanced sorts like Quick Sort and Merge Sort.
Slow Learners: Use gap-based visual worksheets to simulate
Shell Sort passes.
Follow-up Work
Advanced Learners: Implement Shell Sort with different gap
sequences and analyze performance.
Lesson Plan for: Shell Sort – Deep Dive and Implementation

Section Details
1. Understand the working principles of Shell Sort in depth.
2. Learn how gap sequences affect the performance of the algorithm.
Lesson Objectives
3. Implement Shell Sort in code using various gap strategies.
4. Analyze the time complexity for different scenarios.
After the lesson, students will be able to:
✔ Describe how Shell Sort uses gaps to improve insertion sort.
Lesson Outcomes ✔ Implement Shell Sort using a basic or customized gap sequence.
✔ Explain the impact of gap choice on efficiency.
✔ Compare Shell Sort’s performance to other simple sorting methods.
Methods of Dry-run on whiteboard, step-by-step animation, code walkthrough, time
Pedagogy complexity analysis chart.
Visual animations, pseudocode, Python/C program editor, comparative
Teaching Tools
complexity table.
Ask: “What if we sorted distant elements first and refined the result
Motivation /
gradually?”
Introducing the
Use this idea to explain Shell Sort’s gap-based optimization of insertion
Topic (5 min)
sort.
Content - What is Shell Sort?
Presentation – Key → A generalization of Insertion Sort that starts by sorting pairs of elements
Points (40 min) far apart.

- How It Works:
• Choose a gap sequence (e.g., n/2, n/4...1)
• For each gap, perform a gapped insertion sort
• Decrease the gap until it becomes 1

- Pseudocode:
python<br>gap = n // 2<br>while gap > 0:<br> for i in
range(gap, n):<br> temp = arr[i]<br> j = i<br> while j >=
gap and arr[j - gap] > temp:<br> arr[j] = arr[j - gap]<br> j
-= gap<br> arr[j] = temp<br> gap //= 2<br>

- Example Walkthrough:
Input: [23, 12, 1, 8, 34, 54, 2, 3]
Gaps: 4 → 2 → 1

- Gap Sequences:
• Shell’s original: n/2, n/4, ..., 1
• Hibbard, Knuth, Sedgewick sequences (optional advanced discussion)

- Time Complexity:
• Depends on gap sequence
• Worst case: Between O(n log² n) and O(n^2)
Section Details
• Best case (optimized gaps): O(n log n)

- Advantages:
• Efficient for medium-sized datasets
• In-place and simple to implement
Multiple Choice Questions:
1. Shell Sort is a generalization of:
A) Merge Sort
B) Insertion Sort
C) Bubble Sort
D) Heap Sort
Answer: B

2. What is the purpose of the gap in Shell Sort?


A) To insert elements faster
B) To reduce array size
C) To divide array into heaps
D) To avoid recursion
Answer: A

3. What is the best-case time complexity of Shell Sort (with optimized


gaps)?
Assessment: MCQs A) O(n)
(5 min) B) O(n log n)
C) O(n²)
D) O(log n)
Answer: B

4. What happens in the final pass of Shell Sort when gap = 1?


A) Array is divided
B) Bubble Sort is used
C) A full insertion sort is performed
D) Elements are removed
Answer: C

5. Which of the following is a valid gap sequence in Shell Sort?


A) n/2, n/4, ..., 1
B) 1, 2, 3
C) 2ⁿ
D) log(n)
Answer: A
Recap how Shell Sort improves on Insertion Sort using gap sorting.
Summing Up (5
Highlight that gap choice is critical for performance.
min)
Compare with Bubble, Selection, and Insertion Sort.
Follow-up Work Slow Learners: Practice dry-runs with small arrays and trace each pass
Section Details
manually.
Advanced Learners: Implement Shell Sort using Knuth’s gap sequence
and analyze performance.

Lesson Plan for: The "Divide and Conquer" Paradigm & Merge Sort Concepts

Section Details
1. Understand the Divide and Conquer approach in algorithm design.
2. Learn how Merge Sort applies this paradigm to sort elements.
Lesson Objectives
3. Analyze time complexity and behavior of Merge Sort in different
scenarios.
After the lesson, students will be able to:
✔ Explain the steps of the Divide and Conquer strategy.
Lesson Outcomes ✔ Describe and implement Merge Sort using recursion.
✔ Trace the splitting and merging process on sample inputs.
✔ Analyze time and space complexity of Merge Sort.
Methods of Diagram-based walkthroughs, recursion tree tracing, dry-run exercises, live
Pedagogy coding with visualization.
Whiteboard trees, flowchart diagrams, Python/C++ merge sort code,
Teaching Tools
recursion call stack visualizer, split/merge animation.
Motivation / Ask: “How would you sort a massive phone book? All at once or in parts?”
Introducing the Introduce Divide and Conquer as a smart way to solve complex problems
Topic (5 min) by breaking them down.
Content - What is Divide and Conquer?
Presentation – Key → A problem-solving strategy involving 3 steps:
Points (40 min) 1. Divide the problem into subproblems
2. Conquer the subproblems recursively
3. Combine the results of the subproblems

- Merge Sort Algorithm:


→ Divide the array into halves recursively until 1 element remains
→ Merge subarrays in sorted order

- Example Walkthrough:
Input: [38, 27, 43, 3, 9, 82, 10]
Split: [38, 27, 43] and [3, 9, 82, 10] → Continue splitting
Merge: Step-by-step combine sorted halves

- Pseudocode Structure:
python<br>def merge_sort(arr):<br> if len(arr) > 1:<br> mid
= len(arr) // 2<br> L = arr[:mid]<br> R = arr[mid:]<br><br>
merge_sort(L)<br> merge_sort(R)<br><br> merge(L, R, arr)<br>
Section Details
- Time and Space Complexity:
• Time (Best/Worst/Average): O(n log n)
• Space: O(n) (due to temporary arrays)

- Applications:
• Sorting linked lists
• External sorting (large data stored on disk)
• Stable sort needs
Multiple Choice Questions:
1. What are the 3 steps in the Divide and Conquer method?
A) Cut, Repeat, Swap
B) Divide, Conquer, Combine
C) Delete, Copy, Merge
D) Divide, Multiply, Return
Answer: B

2. Which sorting algorithm is based on Divide and Conquer?


A) Bubble Sort
B) Insertion Sort
C) Merge Sort
D) Selection Sort
Answer: C

3. What is the time complexity of Merge Sort in the worst case?


A) O(n)
Assessment: MCQs
B) O(log n)
(5 min)
C) O(n log n)
D) O(n²)
Answer: C

4. Merge Sort is preferred over other sorts when:


A) Input is small
B) Data is in stack
C) Data is large and stored externally
D) Data is random
Answer: C

5. Which of the following is a disadvantage of Merge Sort?


A) Instability
B) Recursive nature
C) Requires extra space
D) Doesn’t work on arrays
Answer: C
Summing Up (5 Recap Divide and Conquer as a problem-solving paradigm.
min) Summarize Merge Sort’s split-merge approach.
Section Details
Mention how it ensures guaranteed O(n log n) time for any input.
Slow Learners: Use visual aids to draw recursion trees for small inputs.
Follow-up Work Advanced Learners: Implement in-place merge sort and analyze space
optimization techniques.

Lesson Plan for: Merge Sort – Implementation and Analysis

Section Details
1. Implement the Merge Sort algorithm using recursion.
2. Understand and write the merge function to combine sorted subarrays.
Lesson Objectives
3. Analyze time and space complexity of Merge Sort.
4. Evaluate the stability and practical applications of Merge Sort.
After the lesson, students will be able to:
✔ Write complete code for Merge Sort in C/Python.
Lesson Outcomes ✔ Break an array into halves and apply recursion correctly.
✔ Merge two sorted arrays using the merge procedure.
✔ Analyze time and space complexity with respect to input size.
Methods of Code tracing with input arrays, dry-runs on whiteboard, step-by-step
Pedagogy debugging, visual recursion tree explanation.
Code editor (Python/C), animation of merge process, sample dry-run sheets,
Teaching Tools
visual call stack simulator.
Ask: “What happens if you split the problem into tiny parts and then solve
Motivation /
each one perfectly?”
Introducing the
Use this to transition into recursive implementation and the merge logic of
Topic (5 min)
Merge Sort.
Content - Merge Sort Algorithm Recap:
Presentation – → Divide array into halves recursively
Key Points (40 → Merge sorted halves back together
min)
- Implementation Details:
1. Recursive merge_sort function to split array
2. Merge function to combine two sorted lists

- Python Pseudocode:
python<br>def merge_sort(arr):<br> if len(arr) > 1:<br> mid =
len(arr) // 2<br> L = arr[:mid]<br> R = arr[mid:]<br><br>
merge_sort(L)<br> merge_sort(R)<br><br> i = j = k = 0<br>
while i < len(L) and j < len(R):<br> if L[i] < R[j]:<br>
arr[k] = L[i]<br> i += 1<br> else:<br> arr[k] = R[j]<br> j +=
1<br> k += 1<br><br> while i < len(L):<br> arr[k] = L[i]<br> i
+= 1<br> k += 1<br><br> while j < len(R):<br> arr[k] =
R[j]<br> j += 1<br> k += 1<br>
Section Details

- Analysis:
• Time Complexity:
Best, Average, Worst = O(n log n)
• Space Complexity:
O(n) (due to temporary arrays)

- Key Properties:
• Stable Sort
• Suitable for Linked Lists and External Sorting

- Use Cases:
→ Sorting large datasets
→ When guaranteed performance is critical
Assessment: Multiple Choice Questions:
MCQs (5 min) 1. What is the core idea behind Merge Sort?
A) Comparing and swapping
B) Repeatedly dividing and merging
C) Using heaps
D) Recursive bubble sort
Answer: B

2. What is the worst-case time complexity of Merge Sort?


A) O(n)
B) O(n log n)
C) O(n²)
D) O(log n)
Answer: B

3. Merge Sort is a ___ sort.


A) Non-comparison based
B) Unstable
C) Divide and conquer
D) In-place
Answer: C

4. What causes Merge Sort to use extra space?


A) Stack overflow
B) Global variables
C) Temporary arrays during merging
D) Recursion depth
Answer: C

5. Which of the following is true about Merge Sort?


A) It’s slow on linked lists
Section Details
B) It cannot be used with external memory
C) It’s stable and predictable
D) It performs worse than Selection Sort
Answer: C
Recap: Split → Recursively Sort → Merge.
Summing Up (5
Emphasize recursive structure and how merging works.
min)
Discuss Merge Sort's reliability and its real-world relevance.
Slow Learners: Work through array merges using worksheets step-by-step.
Follow-up Work Advanced Learners: Modify Merge Sort to count inversions in an array
(advanced problem-solving).

Lesson Plan for: Quick Sort – The Partitioning Logic

Section Details
1. Understand how the Quick Sort algorithm uses partitioning.
2. Learn different partitioning schemes (Lomuto and Hoare).
Lesson Objectives
3. Analyze the role of the pivot element in sorting.
4. Recognize the advantages and limitations of Quick Sort.
After the lesson, students will be able to:
✔ Explain how partitioning separates elements based on a pivot.
Lesson Outcomes ✔ Trace the recursive structure of Quick Sort.
✔ Implement partitioning logic in code.
✔ Analyze time and space complexities in best, average, and worst cases.
Methods of Step-by-step dry-runs, partition animation demos, code implementation,
Pedagogy comparative analysis with Merge Sort.
Whiteboard diagrams, sample trace tables, code snippets (C/Python),
Teaching Tools
partition visualizer (pivot highlighting), sorting cards.
Motivation / Ask: “If you were to organize a set of numbers around one reference point,
Introducing the how would you divide them?”
Topic (5 min) Use this to introduce pivot-based division in Quick Sort.
Content - What is Quick Sort?
Presentation – Key → A Divide and Conquer sorting algorithm that picks a pivot and
Points (40 min) partitions the array.

- Partitioning Logic:
→ Choose a pivot
→ Move elements smaller than pivot to left, larger to right
→ Recursively apply the process to left and right parts

- Popular Partition Schemes:


1. Lomuto Partition (simple, uses last element as pivot)
Section Details
2. Hoare Partition (efficient, uses two indices moving inward)

- Lomuto Example:
python<br>def partition(arr, low, high):<br> pivot =
arr[high]<br> i = low - 1<br> for j in range(low, high):<br>
if arr[j] < pivot:<br> i += 1<br> arr[i], arr[j] = arr[j],
arr[i]<br> arr[i+1], arr[high] = arr[high], arr[i+1]<br>
return i + 1<br>

- Time Complexity:
• Best case: O(n log n)
• Average case: O(n log n)
• Worst case: O(n²) (when array is already sorted or all elements are equal)

- Space Complexity: O(log n) (due to recursion stack)

- Key Characteristics:
• In-place
• Not stable
• Fastest comparison-based sort in practice
Assessment: Multiple Choice Questions:
MCQs (5 min) 1. What is the purpose of the partition step in Quick Sort?
A) Divide into equal halves
B) Rearrange elements around pivot
C) Merge two arrays
D) Find duplicates
Answer: B

2. What is the average-case time complexity of Quick Sort?


A) O(n²)
B) O(n log n)
C) O(n)
D) O(log n)
Answer: B

3. Which partitioning scheme uses the last element as pivot?


A) Merge Partition
B) Hoare Partition
C) Lomuto Partition
D) Binary Split
Answer: C

4. What is a major drawback of Quick Sort in the worst case?


A) Uses extra memory
B) Not recursive
C) O(n²) time
Section Details
D) Too many swaps
Answer: C

5. Is Quick Sort a stable sorting algorithm?


A) Yes
B) No
C) Only for even arrays
D) Depends on pivot Answer: B
Recap the key idea: choose a pivot, partition around it, then recursively sort.
Summing Up (5
Emphasize the importance of good pivot selection for performance.
min)
Compare with Merge Sort’s predictable time but higher space usage.
Slow Learners: Perform partitioning manually using paper number cards
and colored pivots.
Follow-up Work
Advanced Learners: Implement both Lomuto and Hoare partition schemes
and compare their performance on various datasets.

Lesson Plan for: Quick Sort – Recursion and Implementation

Section Details
1. Understand how recursion is applied in Quick Sort.
2. Learn to implement the complete Quick Sort algorithm using recursive
functions.
Lesson Objectives
3. Analyze the time and space complexity based on input and pivot
selection.
4. Identify cases where Quick Sort performs well or poorly.
After the lesson, students will be able to:
✔ Define recursive structure of Quick Sort.
Lesson Outcomes ✔ Implement full Quick Sort in code using partition function.
✔ Trace recursive calls and understand the call stack.
✔ Evaluate the efficiency and space usage of Quick Sort.
Recursive flow diagrams, dry-run examples, code demonstration, stack
Methods of Pedagogy
trace explanation.
Code editor (Python/C), whiteboard recursion tree, flowcharts, partition
Teaching Tools
animations.
Ask: “What if we break down a sorting problem into smaller subproblems
Motivation /
using recursion?”
Introducing the Topic
Link this to how Quick Sort handles sorting efficiently by recursively
(5 min)
applying partitioning.
Content Presentation - Quick Sort Recap:
– Key Points (40 min) → Select a pivot
→ Partition the array into two halves
→ Recursively sort the subarrays
Section Details

- Recursive Quick Sort Function (Python):


python<br>def quick_sort(arr, low, high):<br> if low <
high:<br> pi = partition(arr, low, high)<br>
quick_sort(arr, low, pi - 1)<br> quick_sort(arr, pi + 1,
high)<br>

- Partition Logic (Lomuto):


Already taught in the previous lesson

- Recursive Tree Visualization:


→ Show how the array is divided at each step
→ Explain the stack depth

- Time Complexity:
• Best & Average: O(n log n)
• Worst (already sorted or bad pivot): O(n²)

- Space Complexity: O(log n) (due to recursion stack)

- Optimizations:
• Randomized pivot
• Tail call optimization
Assessment: MCQs (5 Multiple Choice Questions:
min) 1. What is the base case for recursive Quick Sort?
A) When all elements are even
B) When low < high
C) When low >= high
D) When pivot is maximum
Answer: C

2. In Quick Sort, recursive calls are made on:


A) Full array
B) Left and right subarrays around the pivot
C) Even-indexed elements only
D) None
Answer: B

3. What data structure mimics the behavior of recursive function calls?


A) Queue
B) Array
C) Stack
D) Linked List
Answer: C

4. What happens if a bad pivot (e.g., min or max) is always chosen?


Section Details
A) Faster execution
B) No sorting
C) Time complexity degrades to O(n²)
D) Memory increases only
Answer: C

5. What is the key to improving Quick Sort’s performance?


A) Using linked list
B) Sorting only even numbers
C) Choosing a good pivot
D) Avoiding recursion
Answer: C
Recap how Quick Sort uses recursive calls after partitioning.
Highlight why choosing a good pivot is crucial for efficiency.
Summing Up (5 min)
Explain that recursion allows divide-and-conquer to be applied
effectively.
Slow Learners: Use recursion trees on paper to track subarray sizes and
positions.
Follow-up Work
Advanced Learners: Implement randomized Quick Sort and compare
performance against standard pivot-based sort.

Lesson Plan for: Heap Sort – Understanding the Heap Data Structure

Section Details
1. Understand the concept and properties of a heap data structure.
2. Learn the difference between max-heap and min-heap.
Lesson Objectives 3. Understand how a heap supports efficient sorting using Heap
Sort.
4. Trace the process of heapification and its role in sorting.
After the lesson, students will be able to:
✔ Define a heap and describe its structure and properties.
Lesson Outcomes ✔ Distinguish between min-heap and max-heap.
✔ Apply the heap property to construct a binary heap.
✔ Understand the role of the heap in the Heap Sort algorithm.
Heap tree diagrams, array-to-heap conversion walkthrough, dry-run
Methods of Pedagogy
of heapify operations, real-world analogies (priority queue).
Whiteboard tree visuals, heap array simulations, heapify animations,
Teaching Tools
sample C/Python code.
Ask: “How would you always keep track of the largest or smallest
Motivation / Introducing item in a group efficiently?”
the Topic (5 min) Introduce the heap as a special binary tree useful in priority-based
retrieval and sorting.
Section Details
- What is a Heap?
→ A complete binary tree represented using an array
→ Follows the heap property:
• Max-Heap: Parent ≥ children
• Min-Heap: Parent ≤ children

- Heap Structure and Indexing:


• For a node at index i (0-based):
• Left child = 2i + 1
• Right child = 2i + 2
• Parent = (i - 1) // 2

- Heapify Process:
Content Presentation –
• Adjust a subtree to maintain heap property
Key Points (40 min)
• Called from bottom-up to build a heap

- Heap Types and Applications:


→ Max-Heap: Used in Heap Sort
→ Min-Heap: Used in priority queues, scheduling

- Why Heaps Are Efficient:


→ Fast retrieval of largest/smallest in O(1)
→ Insertion/deletion in O(log n)

- Preview of Heap Sort:


→ Build Max-Heap → Swap root with last → Heapify again (to be
discussed in next class)
Assessment: MCQs (5 Multiple Choice Questions:
min) 1. What type of tree is used in a heap?
A) Binary Search Tree
B) AVL Tree
C) Complete Binary Tree
D) Red-Black Tree
Answer: C

2. In a max-heap, which node has the highest value?


A) Last node
B) Root node
C) Any leaf
D) Middle node
Answer: B

3. What does the heap property ensure?


A) Sorted tree
B) Complete balance
Section Details
C) Parent is greater or smaller than children
D) Random order
Answer: C

4. What is the left child index of node at index 2 in an array-based


heap?
A) 4
B) 3
C) 5
D) 6
Answer: C

5. Which of the following is true about heaps?


A) Only works with recursion
B) Requires additional space
C) Can be represented using arrays
D) Uses linked list always
Answer: C
Recap heap structure, heap property, and how array representation
works.
Summing Up (5 min) Introduce the idea that heaps enable efficient sorting and priority-
based processing.
Preview the Heap Sort process using the heap constructed.
Slow Learners: Practice heap tree construction from arrays
manually.
Follow-up Work
Advanced Learners: Implement max-heap and min-heap classes
with insert and delete operations.

Lesson Plan for: Heap Sort – The Sorting Process and Implementation

Section Details
1. Understand how the heap data structure is used for sorting.
2. Learn the steps involved in the Heap Sort algorithm.
Lesson Objectives
3. Implement Heap Sort using array-based heap.
4. Analyze the time and space complexity of Heap Sort.
After the lesson, students will be able to:
✔ Build a max-heap from an unsorted array.
Lesson Outcomes ✔ Apply heapify to maintain heap structure during sorting.
✔ Implement Heap Sort in a programming language.
✔ Analyze the performance and characteristics of Heap Sort.
Methods of Visual dry-runs, step-by-step coding, interactive array-heap transformations,
Section Details
Pedagogy board simulation of heapify.
Python/C code editor, heap simulation animations, heap tree diagrams, dry-
Teaching Tools
run worksheets.
Ask: “What if we always had access to the largest number instantly during
Motivation /
sorting?”
Introducing the
Introduce Heap Sort as a selection-based algorithm using a max-heap for
Topic (5 min)
efficiency.
- Heap Sort Overview:
→ Based on Max-Heap structure
→ Root (maximum) is repeatedly placed at the end

- Steps in Heap Sort:


1. Build a Max-Heap from input array
2. Swap the root with the last element
3. Reduce heap size and heapify the root
4. Repeat until one element remains

- Python-like Pseudocode:
python<br>def heap_sort(arr):<br> n = len(arr)<br> # Build max
heap<br> for i in range(n//2 - 1, -1, -1):<br> heapify(arr, n,
Content i)<br><br> # Extract elements<br> for i in range(n-1, 0, -
Presentation – 1):<br> arr[0], arr[i] = arr[i], arr[0] # Swap<br>
Key Points (40 heapify(arr, i, 0)<br><br>def heapify(arr, n, i):<br> largest
min) = i<br> l = 2*i + 1<br> r = 2*i + 2<br><br> if l < n and
arr[l] > arr[largest]:<br> largest = l<br> if r < n and arr[r]
> arr[largest]:<br> largest = r<br><br> if largest != i:<br>
arr[i], arr[largest] = arr[largest], arr[i]<br> heapify(arr,
n, largest)<br>

- Complexity Analysis:
• Time: O(n log n) for all cases
• Space: O(1) (in-place sort)

- Characteristics:
• Not stable
• In-place
• Suitable for large datasets when stability is not required
Assessment: Multiple Choice Questions:
MCQs (5 min) 1. What is the first step in Heap Sort?
A) Insertion Sort
B) Build a Max-Heap
C) Build a Binary Search Tree
D) Merge the array
Answer: B

2. Where is the maximum element stored in a max-heap?


A) Last node
Section Details
B) Leaf node
C) Root node
D) Random node
Answer: C

3. After placing the max element at the end, what is done next?
A) Insert a new value
B) Heapify the entire array
C) Heapify the root only
D) Delete all elements
Answer: C

4. What is the time complexity of Heap Sort in the worst case?


A) O(n²)
B) O(log n)
C) O(n)
D) O(n log n)
Answer: D

5. Is Heap Sort stable?


A) Yes
B) No
C) Sometimes
D) Only in Python
Answer: B
Recap: Build Max-Heap → Swap root → Heapify → Repeat.
Summing Up (5 Highlight in-place nature and consistent O(n log n) performance.
min) Compare with Quick Sort (faster in practice) and Merge Sort (stable but uses
more space).
Slow Learners: Practice step-by-step heapify and trace heap changes using
worksheets.
Follow-up Work
Advanced Learners: Implement Min-Heap Sort and apply it to priority
scheduling problems.

Lesson Plan for: Radix Sort

Section Details
1. Understand the concept and mechanism of Radix Sort.
2. Learn how Radix Sort processes digits in multiple passes.
Lesson Objectives
3. Differentiate Radix Sort from comparison-based sorting algorithms.
4. Analyze its time complexity and limitations.
Section Details
After the lesson, students will be able to:
✔ Explain how Radix Sort sorts numbers digit by digit.
✔ Perform sorting using LSD (Least Significant Digit) technique.
Lesson Outcomes
✔ Implement Radix Sort using a stable intermediate sort like Counting
Sort.
✔ Compare Radix Sort with comparison-based sorts.
Step-by-step visual sorting of digit places, animation tools, dry-run with
Methods of Pedagogy
base-10 numbers, coding walkthrough.
Slide deck, number cards, digit-wise sorting tables, Python/C code
Teaching Tools
samples, animation of passes.
Motivation / Ask: “How would you sort phone numbers by comparing digits from
Introducing the Topic right to left?”
(5 min) Introduce Radix Sort as a non-comparison, digit-based sorting method.
Content Presentation – - What is Radix Sort?
Key Points (40 min) → A non-comparison sorting algorithm
→ Works by sorting digits starting from least significant digit (LSD) to
most significant digit (MSD)

- Steps of Radix Sort:


1. Find the maximum number to determine number of digits
2. Perform digit-by-digit sort starting from LSD
3. Use a stable sort like Counting Sort in each pass

- Example:
Input: [170, 45, 75, 90, 802, 24, 2, 66]
Sort by unit place → ten’s place → hundred’s place
Final output: [2, 24, 45, 66, 75, 90, 170, 802]

- Python-like Pseudocode:
python<br>def radix_sort(arr):<br> max_num = max(arr)<br>
exp = 1<br> while max_num // exp > 0:<br>
counting_sort(arr, exp)<br>

- Counting Sort Subroutine (stable sort):


Used to sort numbers based on current digit

- Time Complexity:
• O(n * k) where k = number of digits

- Space Complexity: O(n + k)

- Advantages:
• Very efficient when digit length is small
• Works well for fixed-length numbers
Section Details
- Limitations:
• Only works with integers or strings (digit-like keys)
• Extra space required for each digit pass
Multiple Choice Questions:
1. What type of sorting algorithm is Radix Sort?
A) Comparison-based
B) Non-comparison based
C) Hybrid sort
D) Recursive sort
Answer: B

2. What is the primary sorting method used inside Radix Sort?


A) Bubble Sort
B) Merge Sort
C) Counting Sort
D) Heap Sort
Answer: C

3. What does LSD stand for in Radix Sort?


A) Last Sort Digit
Assessment: MCQs (5
B) Least Sorting Digit
min)
C) Least Significant Digit
D) Longest Significant Digit
Answer: C

4. When is Radix Sort most efficient?


A) For large numbers with long digit lengths
B) For floating point numbers
C) For fixed-length integers
D) For recursive sorting
Answer: C

5. What is a limitation of Radix Sort?


A) It is always recursive
B) Cannot be used for sorting numbers
C) Requires a stable intermediate sort
D) Slower than Bubble Sort
Answer: C
Recap: Radix Sort sorts digit by digit using a stable sort like Counting
Sort.
Summing Up (5 min)
Highlight its efficiency with integers and digit-based data.
Compare with Merge/Quick/Heap in terms of strategy and performance.
Follow-up Work Slow Learners: Use paper digit strips to perform digit-wise sorting
manually.
Advanced Learners: Implement Radix Sort for strings (lexicographic
Section Details
sorting) and analyze performance.

Lesson Plan for: Linear Search and Introduction to Searching

Section Details
1. Introduce the concept of searching in data structures.
2. Explain the need for efficient data lookup.
Lesson Objectives
3. Understand the working of Linear Search.
4. Implement Linear Search in a programming language.
After the lesson, students will be able to:
✔ Describe the importance of searching in computing.
Lesson Outcomes ✔ Explain and implement the Linear Search algorithm.
✔ Apply Linear Search to both unsorted and sorted data.
✔ Analyze its time complexity and use cases.
Real-life analogies (e.g., finding a name in a list), whiteboard tracing,
Methods of Pedagogy
code walkthrough, sample dry-run.
Code editor (Python/C), number cards or list sheets, visual tracing on
Teaching Tools
board, slides.
Ask: “How do you find your roll number in an attendance sheet
Motivation /
without knowing the order?”
Introducing the Topic (5
Introduce searching as a fundamental operation and Linear Search as
min)
the simplest method.
Content Presentation – - What is Searching?
Key Points (40 min) → Process of finding the position of a value in a collection of data

- Types of Searching Algorithms:


→ Linear Search
→ Binary Search (introduced later)

- Linear Search Working:


→ Check each element one-by-one from start to end
→ If element found, return position
→ If not found, return -1 or null

- Linear Search Code (Python):


python<br>def linear_search(arr, x):<br> for i in
Section Details
range(len(arr)):<br> if arr[i] == x:<br> return i<br>
return -1<br>

- Example:
Search 25 in [10, 20, 25, 30] → Found at index 2

- Time Complexity:
• Best Case: O(1) (first element)
• Worst Case: O(n) (last element or not present)
• Average Case: O(n/2) ≈ O(n)

- Space Complexity: O(1)

- Use Cases:
→ When data is unsorted
→ Simple searches on small datasets
Assessment: MCQs (5 Multiple Choice Questions:
min) 1. What is the time complexity of Linear Search in worst case?
A) O(1)
B) O(n)
C) O(log n)
D) O(n²)
Answer: B

2. In Linear Search, how are elements checked?


A) Binary order
B) Randomly
C) Sequentially
D) Using heap
Answer: C

3. Which type of data is suitable for Linear Search?


A) Sorted only
B) Unsorted or sorted
C) Binary tree
D) Stack
Answer: B

4. If an element is not present, what does Linear Search return?


A) 0
B) Last index
C) -1 or Not found
D) Random position
Answer: C
Section Details
5. What is the space complexity of Linear Search?
A) O(n)
B) O(n log n)
C) O(1)
D) O(n²)
Answer: C
Recap: Linear Search checks all elements until match is found.
Summing Up (5 min) Emphasize it is simple but inefficient for large datasets.
Introduce Binary Search as the next topic for sorted data.
Slow Learners: Practice manually checking elements in small arrays.
Follow-up Work Advanced Learners: Compare execution time of Linear vs Binary
Search on the same dataset.

You might also like