Lesson Plan For DSA 2nd Year
Lesson Plan For DSA 2nd Year
• Bubble Sort and Selection Sort: ▪ Solve problems that require • Recursive Practice: Codeforces -
o Step-by-step implementation sorting (e.g., sorting student Recursive Practice
o Time and space complexity analysis marks) • Palindrome Partitioning: Codeforces
• Real-world use cases of sorting - Palindrome Partitioning
Advanced Sorting Techniques (2 Hours)
• Merge Sort: Sorting Problems LeetCode
o Divide-and-conquer approach • Implement Merge Sort and • Merge Sort Implementation:
o Step-by-step implementation Quick Sort LeetCode - Merge Sort
o Time and space complexity analysis • Solve problems requiring sorted • Quick Sort Implementation:
• Quick Sort: data for optimization LeetCode - Quick Sort
o Pivot selection techniques Hashing Problems • Two Sum (Hashing): LeetCode - Two
3
o Partitioning logic • Implement a hash table using Sum
o Best, average, and worst-case analysis chaining Codeforces
Introduction to Hashing (2 Hours) • Solve frequency count problems • Sorting for Efficient Search:
• Basics of hashing: Definition and use cases (e.g., count occurrences of Codeforces - Sorting
• Hash functions and collision handling techniques (Chaining, Open elements in an array) • Hashing Challenge: Codeforces -
Addressing) Hashing
• Applications of hashing: Dictionary, frequency count, etc.
LeetCode
Basics of Linked Lists (2 Hours)
• Reverse a Linked List: LeetCode -
• Introduction to linked lists:
Linked List Problems Reverse Linked List
o Difference between arrays and linked lists
• Implement a singly linked list • Detect Cycle in Linked List:
• Types of linked lists: Singly, Doubly, and Circular
with insertion and deletion LeetCode - Linked List Cycle
4 • Operations:
• Reverse a linked list Codeforces
o Insertion, Deletion, Traversal
• Detect and remove a loop in a • Linked List Problem: Codeforces -
Applications of Linked Lists (2 Hours)
linked list Linked List
• Implementing stacks and queues using linked lists
• Remove Duplicates in Linked List:
• Solving problems like reversing a linked list and detecting loops
Codeforces - Remove Duplicates
Stacks (2 Hours)
Stack Problems LeetCode
• Introduction to stacks: LIFO principle
5 • Implement a stack using arrays • Valid Parentheses: LeetCode - Valid
• Operations: Push, Pop, Peek
and linked lists Parentheses
• Applications: Expression evaluation, balancing parentheses
Queues (2 Hours) • Solve problems like balancing • Implement Stack using Queues:
• Introduction to queues: FIFO principle parentheses and evaluating LeetCode - Implement Stack
• Types of queues: Normal, Circular, Priority postfix expressions Codeforces
• Applications: Scheduling, buffer management Queue Problems • Stack Data Structure: Codeforces -
• Implement a circular queue. Stack
• Solve problems like simulating a • Queue Implementation: Codeforces
job queue - Queue
LeetCode
• Binary Tree Inorder Traversal:
Basics of Trees (2 Hours) LeetCode - Inorder Traversal
Tree Problems
• Definition and terminology (node, edge, height, depth, etc.) • Binary Tree Level Order Traversal:
• Implement DFS (Inorder,
• Binary trees: Types and properties LeetCode - Level Order Traversal
Preorder, Postorder) and BFS
6 • Applications of trees in search and storage Codeforces
traversals
Tree Traversals (2 Hours) • Binary Tree Depth: Codeforces -
• Solve problems like finding the
• Depth-First Search (DFS): Inorder, Preorder, Postorder Binary Tree Depth
height of a binary tree
• Breadth-First Search (BFS): Level-order traversal • Tree Traversals Challenge:
Codeforces - Tree Traversals
LeetCode
Introduction to Binary Search Trees (2 Hours) • Validate Binary Search Tree:
• Definition and properties of BST BST Problems LeetCode - Validate BST
• Insertion and deletion in a BST • Implement insertion, deletion, • Lowest Common Ancestor of BST:
• Searching in a BST and search operations in a BST LeetCode - LCA in BST
7
Applications of BST (2 Hours) • Solve problems like finding the Codeforces
• Use cases like maintaining sorted data and efficient searching minimum and maximum • Binary Search Tree Implementation:
• Solving problems like finding the lowest common ancestor (LCA) and elements in a BST Codeforces - BST
range queries • BST Search and Delete: Codeforces -
Search and Delete
Basics of Heaps (2 Hours)
Heap Problems LeetCode
• Min-heaps and max-heaps: Properties and structure
8 • Implement a min-heap and max- • Merge k Sorted Lists: LeetCode -
• Insertion and deletion in heaps
heap Merge k Sorted Lists
• Heapify process and building a heap
Priority Queues (2 Hours) • Solve problems like merging k • Kth Largest Element in an Array:
• Implementing priority queues using heaps sorted arrays using heaps LeetCode - Kth Largest
• Applications: Scheduling tasks, finding the k largest/smallest elements Codeforces
• Priority Queue Problem: Codeforces
- Priority Queue
• Heaps Implementation: Codeforces
- Heap Problem
LeetCode
• Clone Graph: LeetCode - Clone
Basics of Graphs (2 Hours)
Graph
• Graph terminology (vertices, edges, adjacency list/matrix). Graph Problems
• Number of Connected Components
• Types of graphs: Directed, undirected, weighted, unweighted. • Implement DFS and BFS.
in an Undirected Graph: LeetCode -
9 2. Graph Traversals (2 Hours) • Solve problems like detecting a
Connected Components
• Depth-First Search (DFS). cycle in a directed/undirected
Codeforces
• Breadth-First Search (BFS). graph
• BFS Traversal: Codeforces - BFS
• Applications: Finding connected components, detecting cycles
• Graph Connectivity: Codeforces -
Graph Connectivity
LeetCode
• Dijkstra's Algorithm: LeetCode -
Shortest Path Basics (2 Hours) Shortest Path Problems Dijkstra's Algorithm
• Dijkstra’s Algorithm: Single-source shortest path. • Implement Dijkstra’s and • Bellman-Ford Algorithm: LeetCode -
• Bellman-Ford Algorithm: Handling negative weights. Bellman-Ford algorithms. Bellman-Ford
10
Applications of Shortest Path Algorithms (2 Hours) • Solve real-world scenarios like Codeforces
• Network routing. finding the shortest route in a • Dijkstra’s Algorithm in Graphs:
• Solving problems like finding the shortest path in a weighted graph. city map Codeforces - Dijkstra
• Shortest Path Challenge: Codeforces
- Shortest Path
Basics of DP (2 Hours) DP Problems LeetCode
• Definition and need for DP. • Solve problems like LCS and 0/1 • Fibonacci Number: LeetCode -
11 • Principles of overlapping subproblems and optimal substructure. Knapsack using DP. Fibonacci
• Memoization vs. Tabulation. • Practice converting recursive • 0/1 Knapsack Problem: LeetCode -
Classic DP Problems (2 Hours) solutions to DP-based solutions 0/1 Knapsack