Lesson Plan Data Structure Final
Lesson Plan Data Structure Final
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
- 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
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:
- 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
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.
- 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
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
- Advantages:
→ Dynamic size
→ Efficient for sparse and unpredictable trees
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
- 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
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
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
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).
- 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
3. What is the root node in the expression tree for "A + B * C"?
A) +
B) *
C) A
D) Cannot determine
Answer: A
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
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.
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
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
- 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
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
- 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
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:
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
- 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
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)
- 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
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²)
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²)
- 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
- 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]
- Time Complexity:
• Best, Average, Worst: O(n²)
- 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
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
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
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
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
- 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
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
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
- 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)
- 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
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
- Time Complexity:
• Best & Average: O(n log n)
• Worst (already sorted or bad pivot): O(n²)
- 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
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
- Heapify Process:
Content Presentation –
• Adjust a subtree to maintain heap property
Key Points (40 min)
• Called from bottom-up to build a heap
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
- 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
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
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)
- 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>
- Time Complexity:
• O(n * k) where k = number of digits
- 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
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
- 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)
- 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