0% found this document useful (0 votes)
53 views26 pages

FBPC Ic VJTWbakx TQ

Uploaded by

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

FBPC Ic VJTWbakx TQ

Uploaded by

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

Data structures and Algorithms using C++

SPEDS402 Apply Data structures and Algorithms using C++

RQF Level: 4 Learning Hours


110
Credits: 11
Sector: ICT and Multimedia
Trade: Software Programming and Embedded Systems
Module Type: Specific Module
Curriculum: ICTSPE4002 TVET Certificate IV in Software Programming and
Embedded System

Copyright: © Rwanda TVET Board, 2023

1200 Issue Date: August 2023


Purpose This module aims to equip learners with the knowledge and skills necessary to
statement proficiently apply data structures in problem-solving scenarios and adeptly write C++
programs. By the end of this module, learners will be able to Apply C++ programming
concepts, Analyze data structure and algorithms, Implement Linear Data Structure,
Implement Non Linear Data Structure, Implement Hash Table and handle Data
Retrieval, and Apply recursion for solving complex problems using C++.

Additionally, learners will gain a comprehensive understanding of hash table


implementations for efficient data retrieval and collision handling. With these
competences, learners will be empowered to tackle complex challenges
independently, ensuring efficient and effective problem-solving in C++ programming.
Learning - Fundamentals of Programming with C
assumed to be - Mathematics
in place - Computer basics
- Basics of Algorithms, Pseudo Code and Flowcharts
Delivery Training delivery 100 Assessment Total
modality % 100%
Theoretical content 40% 30%
Practical work:
Group project 40% Formative
and 50%
60% assessment 70%
presentation
Individual project 60%
/Work
Summative Assessment 50%

Elements of Competence and Performance Criteria


Element of competence Performance Criteria
1.1 Overview of C++ programming concepts are well defined
based on the kind of application to be developed
1. Apply C++ programming 1.2 Complex problems with C++ are accurately solved using
concepts. functions based on their kind of inputs.
1.3 Object-Oriented Programming is well defined based on data
and behavior of the object.
2. Analyze data 2.1 Time complexity and its relevance are well defined based
on the data structure.
structure and 2.2 Big O notation are accurately calculated for various
algorithms operations based on different data structures.
2.3 Operation time complexity are properly analyzed based
on varying input sizes
2.4 Abstract Data Structures are properly described based
on solution to be implemented.
3.1 Array Elements are proficiently manipulated based on
linear data structures
3.2 Sorting and searching algorithms are efficiently applied
based array data structure and language constructs.
3. Implement Linear Data
3.3 Linked List is correctly implemented using structures and
Structure classes based on their application
3.4 Stack is correctly implemented using arrays and linked
lists based on their application on the data structures
3.5 Queue is appropriately implemented using Arrays and
linked lists based on their application on the data structures
4.1 Tree structures and operations are properly implemented
and manipulated based on their application on the data
structures
4.2 Graphs structures and operations are properly
4. Implement Non-Linear
implemented based on their application on the data
Data Structure structures
4.3 Map data structures and algorithms are properly
implemented based on their application on the data
structures.
4.1 Hash tables are accurately designed in accordance to
established hash function principles and memory allocation
standards.
4.2 Hash table Data retrieval concept are properly applied in
5. Implement Hash Table accordance with the problem context.
and handle Data Retrieval 4.3 Indices are properly generated based on hash functions
application for data storage within the hash table.
4.4 Collision resolution strategies are appropriately
implemented aligning with the chosen technique

6.1 Recursion concept are well defined based on recognized


principles
6. Apply recursion for 6.2 Recursive function are properly implemented in line with
data structure manipulation techniques
solving complex problems 6.3 Algorithm are efficiently designed in line with complex
using C++ problem-solving tasks
6.4 Base cases are accurately identified and used based on
recursion handling techniques
Intended Knowledge, Skills and Attitude
Knowledge Skills Attitude

✓ understandC++ ✓ Set C++ enveronment ✓ Use creativity and


programming language ✓ Apply C++ concepts innovation throughout the
✓ Describe the complex ✓ Calculate Big O notation design works
problem ✓ Analyze operation time ✓ Pay attention to projects
✓ Describe OOP concepts complexity details
✓ Identify Time complexity ✓ Manipulate Array elements ✓ Demonstrate punctuality
✓ Describe Abstract data ✓ Apply sorting and searching during the implementation
structures algorithm of project
✓ Define Recursion concept ✓ Implement linked list using ✓ Be resourceful
✓ Identify Base cases structure and classes.
✓ Explain algorithms on ✓ Implement Stack using arrays
data structure and linked list
✓ Implement Queue using
arrays and linked list
✓ Implement tree structure and
operations
✓ Implement Graphs structure
and operations
✓ Implement Map data
structure and algorithms
✓ Design Hash tables
✓ Generate storage Indices
✓ Implement Collision
resolution strategies
✓ Implement Recursion
concept
✓ Prepare design project
presentation

Course content
Learning outcomes At the end of the module the learner will be able to:

1. Apply C++ programming concepts.


2. Analyze Data structure and Algorithms
3. Implement Linear Data Structure
4. Implement Non-Linear Data Structure
5. Implement Hash Table and Handle Data
Retrieval
6. Apply Recursion for Solving Complex Problems
with C++

Learning outcome 1: Apply Learning hours: 10


advanced programming
concepts with C++.

Indicative content

• C++ programming concepts


✓ C++ program
✓ C++ Keywords
✓ C++ Namespaces
Declaration of namespace
Calling a namespace
Access variables in a namespace
• Input vs output
✓ Input(cin) and extraction operator (>>)
✓ Output(cout) and insertion operator (<<)
✓ Complex input: lines, multiple inputs
✓ Output formatting
✓ endl,
• Develop a C++ user-defined function to solve a problem
✓ Define the problem to be solved
✓ Function declaration
✓ Function calling and calling conventions
✓ Passing values between functions
✓ Scope rule of functions
✓ Recursive function

• Object Oriented Programming in C++


✓ Basic concepts
✓ Class and Objects in C++
✓ Class Methods
✓ Constructors and destructors
✓ Encapsulation in C++
✓ Inheritance in C++
✓ Polymorphism in C++ (Overloading vs Overriding)
✓ Templates

Resources required for the learning outcome

Equipment Computers
Projector
Internet
Materials Textbooks
Online Tutorials on data structures and C++ programming
Tools IDE
Compiler
Facilitation techniques ▪ Brainstorming
▪ Group discussion on implementing linear data structures in C++
▪ Practical exercise on implementing linear data structures in C++
Formative ▪ Written assessment
assessment methods ▪ Practical assessment
/(CAT)

Learning outcome 2: Analyze Data Learning hours: 10


Structures and algorithms
Indicative content

● Understanding Time Complexity and Relevance:

✔ Defining Time Complexity:


Introducing the concept of time complexity and its significance.
Explaining how time complexity influences algorithm analysis.

✔ Influence of Data Structures on Time Complexity:


Investigating how different data structures impact algorithm performance.
Understanding why some data structures are more suitable for specific
tasks.

✔ Relationship Between Data Structures and Algorithms:


Exploring the interplay between data structures and algorithm design.
Discussing how algorithmic choices relate to the efficiency of data
manipulation.

● Calculating Big O Notation for Operations:

✔ Introduction to Big O Notation:


Introducing Big O notation as a tool for algorithm complexity analysis.
Understanding the notation's role in comparing algorithm efficiencies.

✔ Big O Notation Calculation:


Guided examples of calculating Big O notation for different operations.
Demonstrating the process of simplifying and expressing complexities.

✔ Comparing Big O Notations Across Data Structures:


Comparing Big O notations for common operations across various data
structures.
Identifying patterns in complexity calculations for different scenarios.

● Analysing Operation Time Complexity:

✔ Evaluating Time Complexity of Operations:


Analyzing the time complexity of operations on different data structures.
Discussing scenarios where operations perform differently.

✔ Impact of Input Sizes on Complexity:


Examining how varying input sizes influence operation time complexity.
Understanding how algorithm efficiency scales with input growth.

✔ Practical Application for Time Complexity Analysis:


Engaging in hands-on exercises to calculate and compare time complexities.
Applying theoretical concepts to real-world data structure scenarios.

● Analysis of Space complexity


✓ Analyse the space used based on the inputs provided
✓ Space complexity of operations on different data structures

● Introduction to Data Structures

✓ Introduction to data and data Types


✓ Definition of data
✓ Data significance in programming.
✓ Explanation of different data types (integers, floating-point numbers, Characters,
Boolean, derived, pointer)
✓ Role of data types

✓ Primitive types of Memory


✓ Introduction to memory
✓ Memory role in storing data
✓ Primitive memory types ( stack and heap)
✓ stack vs heap memory
✓ Primitive vs. Reference types in memory

✓ Data Structures overview


✓ Introduction to data structures
✓ Data Structure significance in organizing and managing data.
✓ Types of data structures (linear and non-linear)
✓ Common data structures (arrays, linked lists, stacks, queues, trees, and graphs.)

● Introduction to Data Structure Analysis:

✔ Significance of Data Structure Analysis:


Recognizing the role of data structure analysis in software development.
Exploring how efficient data structures enhance solution performance.

✔ Impact of Proper Data Structure Selection:


Examining the influence of data structure selection on solution efficiency.
Understanding how incorrect data structure choices can lead to performance
issues.

● Selecting Efficient Data Structures:

✔ Factors Influencing Data Structure Choice:


Exploring factors like data size, access patterns, and problem requirements.
Analyzing scenarios where specific data structures are most effective.

✔ Evaluating Problem Requirements:


Assessing problem characteristics to determine appropriate data structures.
Matching problem domains with suitable data structure properties.

✔ Demonstrating Impact with Real-World Examples:


Showcasing real-world scenarios where proper data structure selection is
critical.
Highlighting examples of improved efficiency through careful data structure
choice.
Resources required for the Learning outcome

Equipment Computers
Projector
Internet
Materials Textbooks
Online Tutorials on data structures and C++ programming
Tools IDE
Compiler
Facilitation ⮚ Brainstorming
techniques ⮚ Group discussion on comparing and contrasting different data
structures based on their characteristics and use cases
⮚ Demonstration on using time complexity analysis to evaluate the
efficiency of data structure operations
⮚ Practical exercise on solving problems using different data structures
and discussing their implications on efficiency
Formative ✔ Oral assessment
assessment ✔ Written assessment
✔ Practical assessment
methods /(CAT)

Learning outcome 3: Learning hours: 40


Implement Linear Data
Structure

Indicative content

● Implementation of Arrays

✓ Introduction to Array
✓ Purpose of Using arrays in programming
✓ Data storage and access.
✓ Declaration of Array
✓ Syntax for declaring an array in C++ and datatype
✓ Defining the array size or dimensions.
✓ Use of Arrays in C++
✓ Accessing and manipulating array elements.
✓ Inserting an element in array
✓ Deleting an element in an array

✓ Vectors in Arrays
✓ Introduction to dynamic arrays using vectors (std::vector).
✓ Static arrays vs vectors.
✓ Vector functions use for array-like operations
✓ Dynamic arrays with pointers
✓ Multi-Dimensional Arrays
✓ Description multi-dimensional arrays beyond 1D arrays.
✓ Explanation of (2D), (3D), and nD arrays.
✓ Practical use cases for different dimensions.

✓ Jagged Arrays
✓ Definition and concept
✓ Jagged arrays vs. regular multi-dimensional arrays.
✓ The use of jagged arrays.

● Sorting Algorithms
✓ Description of Sorting Algorithms
✓ Common Sorting Algorithms:
✓ Bubble sort,
✓ Selection sort,
✓ Insertion sort,
✓ Merge Sort
✓ Quick sort,
✓ Heap sort
● Implementation of common Sorting Algorithms(Bubble, selection, insertion,
Merge, Quick, Heap)
✓ Description
✓ Implementation
✓ Time and space complexity

● Comparing algorithms based on their approach, complexity, and use cases.


● Built-in sorting functions in C++.
● Choosing Sorting Algorithms

● Implementation of Searching Algorithms


✓ Importance of Searching Algorithms in data retrieval.
Linear Search
Binary Search (sorted Data)
Application of searching algorithms
Algorithms approach, complexity, and use cases.
Suitable data scenarios for each algorithm.
Comparing binary search and linear search
● Optimizing Searching Algorithms
Exploring techniques to optimize searching algorithms.
Binary search optimizations and their impact on efficiency.
Handling large datasets and improving search speed.

● Implementation of Linked Lists

✓ Introduction to linked lists


✓ Linked lists as a data structure
✓ Linked lists vs. other data structures (arrays)
✓ The dynamic nature of linked lists and their advantages

✓ Descriptions of linked lists


✓ Singly Linked List(Description and advantages)
✓ Doubly Linked List (Characteristics and benefits)
✓ Circular Linked List (Features and use cases)
✓ Doubly Circular Linked List (Introduction and practicality)
✓ Skip List (Overview and applications)
✓ Self-Adjusting List (Understanding its purpose and advantages)

✓ Pros and Cons of linked lists


✓ Operations performed on linked lists.
✓ Insertion methods (beginning, middle, end).
✓ Deletion
✓ Traversal
✓ Searching elements
✓ Modification (Updating node values or attributes)
✓ Reversal

✓ Build a linked list in C++


✓ Construction of a linked list in C++.
✓ Creation of nodes and linking them together.
✓ Role of pointers in implementing linked lists.

✓ Use linked lists in C++


✓ Applications of linked lists in real-world scenarios.
✓ Use of linked lists
✓ Flexibility of linked lists in various contexts.

● Implementation of Stacks

✓ Introduction to Stacks
✓ Stacks as a fundamental data structure.
✓ Stack role and relevance in programming.
✓ Last-In-First-Out (LIFO) nature of stacks.
✓ Illustrating scenarios where LIFO behaviour is applicable

✓ Pros and Cons of Stacks


✓ Stack advantages/disadvantages
✓ Stack limitations and drawbacks

✓ Representation of Stack
✓ Representation of a stack data structure.
✓ "Top" element and its significance.

✓ Stack ADT (Abstract Data Types)


✓ Defining the abstract behavior
✓ Stack ADT Operations

✓ Implementing Stacks using array representation in C++


✓ Array use to implement a stack
✓ Creating a stack using arrays in C++
✓ Push and Pop Operations.

✓ Stacks operations using Linked Links


✓ Use linked lists to implement stack operations.
✓ Benefits of using linked lists
✓ Push and Pop operations execution
✓ Use of Stacks in C++
✓ Application in solving problems (convert Infix expression to postfix, postfix
expression evaluation, etc.)

● Implementation of Queues
✓ Introduction to Queues
✓ Queue Concept
✓ FIFO Principle
✓ Real-world Queue Applications

✓ Pros and Cons of Queues


✓ Advantages of using queues
✓ Limitations and drawbacks of queues
✓ Scenarios where queues are most effective

✓ Implementation of queues in C++


Using array
Using Stacks
Using lists
Use of Queues in C++
FIFO Order Application
Maintaining Data Order
Specialized Queues in Linear Data structures
Specialized types of queues (simple, priority, double-ended, circular,
Bounded, blocking, concurrent, ...)
Implementing priority queues using heaps
Specialized queues application

Resources required for the learning outcome

Equipment Computers
Projector
Internet
Materials Textbooks
Online Tutorials on data structures and C++ programming
Tools IDE
Compiler
Facilitation techniques ⮚ Brainstorming
⮚ Group discussion on implementing linear data structures in C++
⮚ Practical exercise on implementing linear data structures in C++
Formative ✔ Written assessment
assessment methods ✔ Practical assessment
/(CAT)

Learning outcome 4: Implement Non Learning hours: 25


Linear Data Structure
Indicative content

● Trees Concepts

✔ Introduction to Trees
Trees as Hierarchical data structures
Trees in various applications
✔ Types of Trees
Binary Trees
Binary Search Trees (BST)
Balanced Tree Concepts
B-Trees

✔ Tree Traversal Techniques


In order, Pre-Order, and Post-Order Traversals
Level-Order traversal for breadth-first exploration
✔ Tree Operations and Algorithms
Insertion and Deletion of Nodes in BST
Balancing Operations in Self-Balancing Trees
Search and Modifications Algorithms
✔ Implementing Trees in C++:
✔ Tree Implementation
Use of Classes / Structs for tree nodes
Recursive methods for insertion, deletion, and traversal
● Graph concepts

✔ Introduction to Graphs
Graphs as collections of nodes and edges
Real World scenarios where graphs model relationships

✔ Types of Graphs
✔ Graph Representation
Adjacency Matrix (Pros and Cons)
Adjacency List (Space and Time efficiency)

✔ Graph Traversal
Depth-First Search (DFS)
Breadth-First Search (BFS)

✔ Application of Graphs
Shortest Path Algorithms
Minimum Spanning Trees
Topological Sorting

● Implementing Graphs in C++:


✔ Graph Implementation

Node and Edge classes for graph representation


Storing graphs using adjacency lists
✔ Utilizing Standard Libraries
C++ STL for data structures
Use STL containers for tree and graph operations
● Map Data Structures and Algorithms

✔ Introduction to map data structures (associative arrays)


Defining map data structures and their role in data storage
The concept of associative arrays
the importance of efficient key-value storage
✔ Key-value pairs and their role in data storage
The concept of key-value pairs
Role of key-value pairs in data organization and retrieval
Relationship between keys and values
✔ Map operations: insertion, deletion, retrieval
Inserting key-value pairs into a map.
Techniques for deleting entries from a map.
Retrieving values based on given keys.
Handling cases of duplicate keys and updating values.
✔ Exploring C++ implementations: std::map and std::unordered_map
Introduction to std::map and std::unordered_map in C++ STL
The differences between ordered and unordered maps
The usage of map implementations in C++
✔ Application of maps in data association and problem solving
Using maps for dictionary and spell-check applications.
Maps in implementing frequency counters.
Using maps for efficient data association.

● Problem Solving and Optimization of Graphs and Trees with C++

✔ Constructing Binary Trees:


Building binary trees and BSTs using C++
Techniques for insertion, deletion, and traversal

✔ Creating and Navigating Graphs:


Graph creation and defining edge associations
Algorithms to traverse and explore graphs

✔ Family Tree Representation:


Applying binary trees to model family genealogy
Precise traversal for family relationships exploration

✔ Social Network Analysis:


graph representation of social connections
algorithms to discover mutual friends

✔ Handling Imbalanced Trees:


Balancing techniques for BST
Rotations and rebalancing operations
✔ Graph Algorithms Optimization:
Optimize efficiency in graph traversal
Strategies for faster shortest path calculations

Equipment Computers
Projector
Internet
Materials Textbooks
Online Tutorials on data structures and C++ programming
Tools IDE
Compiler
Facilitation ⮚ Brainstorming
techniques ⮚ Group discussion on the application of non-linear data structures
⮚ Demonstration on implementing non-linear data structures like trees
and graphs in C++
⮚ Practical exercise on coding non-linear data structures
Formative ✔ Oral assessment
assessment ✔ Written assessment
✔ Practical assessment
methods /(CAT)

Learning outcome5: Implement Learning hours:10


Hash Table and handle Data
Retrieval
Indicative content

● Introduction to Hash Tables

✔ Hash Tables Description


Overview of hash tables as efficient data storage structures
Importance of hash tables in solving data retrieval challenges
Role of hash functions in hash table design

✔ Memory Allocation and Hash Tables


Principles of memory allocation in hash table implementation
Allocating memory for hash table components
Analyzing memory allocation's impact on hash table performance

● Hash Function Principles

✔ Hash Function Basics


Exploring the fundamental concepts of hash functions
Understanding how hash functions generate indices
Relationship between data and hash table indices

✔ Hash Function Design


Factors influencing hash function design.
Principles for creating effective hash functions.
Hash function collision avoidance strategies.

● Data Retrieval in Hash Tables

✔ Data Retrieval Concepts:


Importance of efficient data retrieval in hash tables.
Applying hash table data retrieval to real-world problems.
Techniques for enhancing data retrieval performance.
✔ Problem Context and Hash Table Retrieval:
Adapting hash table data retrieval to specific problem contexts.
Matching retrieval methods with data retrieval requirements.
Ensuring data integrity during hash table retrieval.

● Generating Indices with Hash Functions

✔ Indices Generation and Storage:


Implementing hash functions to generate indices.
Mapping data to hash table indices.
Handling index distribution for optimized data storage.

✔ Hashing for Data Storage:


Correlation between hash functions and data storage.
Mapping data to hash table indices using hash functions.
Strategies for handling hash collisions.

● Collision Resolution Strategies

✔ Introduction to Collision Resolution:


Introduction to collision resolution in hash tables.
Challenges posed by hash collisions.
Importance of suitable collision resolution techniques.

✔ Collision Resolution Techniques:


Detailed exploration of collision resolution methods.
Implementing open addressing for collision resolution.
Chaining technique for resolving hash collisions.

✔ Open Addressing:
Understanding open addressing as a collision resolution technique.
Implementing linear probing, quadratic probing, and double hashing.
Exploring scenarios where open addressing is effective and its
limitations.

✔ Chaining:
Understanding chaining as a collision resolution technique.
Implementing linked lists for collision resolution.
Exploring scenarios where chaining is effective and its limitations.

✔ Efficient Hash Table Design:


Strategies for designing hash functions that distribute data uniformly.
Analyzing the impact of hash function quality on hash table
performance.
Techniques to minimize collisions and maximize retrieval efficiency.

✔ Appropriate Implementation of Collision Resolution:


Aligning collision resolution with chosen hash table design.
Analyzing collision resolution's impact on data retrieval.
Identifying scenarios where specific collision resolution techniques
excel

● Implementation of Hash Tables:

✔ Designing and Implementing Hash Tables:


Hash table design based on hash function principles.
Implementation of hash table components.
Application of memory allocation standards to hash table design.

✔ Hash Table Data Retrieval:


Practical exercises for retrieving data from hash tables.
Adapting data retrieval techniques to diverse problem contexts.
Analyzing data retrieval efficiency using hash tables.

✔ Indices Generation and Collision Handling:


Implementing hash functions and generating indices in a lab setting.
Implementing collision resolution strategies in hash tables.
Analyzing index distribution patterns and addressing collisions.

● Real-World Applications of Hash Tables

✔ Application of Hash Tables for Data Management:


Implementing hash tables to solve real-world problems.
Hash tables' role in efficient data storage and retrieval.
Evaluating hash tables' advantages in specific scenarios.

✔ Data Integrity and Performance Optimization:


Optimizing data storage using hash tables.
Real-world applications of hash tables in managing data.
Comparing hash table performance with other data structures.

Resources required for the Learning outcome

Equipment Computers
Projector
Internet
Materials Textbooks
Online Tutorials
Tools IDE
Compiler
Facilitation ⮚ Brainstorming
techniques ⮚ Group discussion on different collision resolution strategies and
their pros and cons
⮚ Demonstration on designing and implementing hash tables in C++
⮚ Practical exercise on coding hash table operations and collision
resolution techniques
Formative ✔ Oral assessment
assessment ✔ Written assessment
✔ Practical assessment
methods /(CAT)
Learning outcome 6: Apply recursion Learning hours: 15
for solving complex problems using
C++
Indicative content

● Introduction to Recursion

✔ Understanding the Role of Recursion


The significance of recursion in problem-solving.
How recursion simplifies complex problems.

✔ Exploring Recursion in Programming


How recursion is employed in algorithm design.
Real-world applications of recursive thinking.

● Understanding Recursion Concepts

✔ Defining Recursion
Core principles of recursion.
Recursive calls and their sequence.

✔ Base Cases in Recursion


The importance of base cases in recursive algorithms.
Identifying base cases for different problems.
How base cases prevent infinite recursion.

● Implementing Recursive Functions

✔ Recursive Function Structure


Anatomy of a recursive function.
Recursive calls and termination conditions.

✔ Coding Techniques for Recursion


Strategies for writing effective recursive functions.
Handling parameters and arguments in recursive calls.

✔ Avoiding Common Mistakes


Pitfalls and errors to avoid in recursive code.
Debugging recursive functions effectively.

● Recursion in Data Structure Manipulation

✔ Recursive Data Structure Traversal


Traversing trees using recursion.
Navigating graphs with recursive techniques.

✔ Recursive Manipulation Examples


Recursive insertion and deletion in trees.
Applying recursion to complex data structure operations.

● Efficient Algorithm Design with Recursion

✔ Strategies for Efficient Recursive Algorithms


Divide and conquer approach in recursion.
Memorization and dynamic programming techniques.

✔ Recursion vs. Iteration


Comparing recursive and iterative algorithm performance.
Identifying scenarios where recursion is advantageous.

✔ Case Studies of Complex Problem-Solving


Real-world examples of complex problems solved with recursion.
Analyzing algorithm efficiency in recursive solutions.

● Identifying and Using Base Cases

✔ Base Cases
Role of base cases in recursive algorithms.
Ensuring termination with appropriate base cases.

✔ Identifying Appropriate Base Cases


Strategies for selecting base cases for different problems.
Identifying recurring patterns for base cases.

✔ Coding Effective Base Cases


Implementing base cases in recursive functions.
Avoiding common errors in base case coding.

● Hands-on Application
✔ Coding Recursive Functions
Hands-on lab for writing recursive functions.
Applying recursion to data structure manipulation.

✔ Recursion in Algorithm Design


Designing algorithms using recursion.
Comparing recursive and iterative solutions.

● Real-World Applications

✔ Solving Complex Problems with Recursion


Demonstrating recursion's role in complex problems.
Analyzing algorithm performance in recursive solutions.

✔ Recursive Data Structure Manipulation


Applying recursion in tree and graph operations.
Solving interconnected data problems with recursion.

Resources required for the Learning outcome

Equipment Computers
Projector
Internet
Materials Textbooks
Online Tutorials on data structures and C++ programming
Tools IDE
Compiler
Facilitation ⮚ Brainstorming sessions to explore creative ways of using recursion in
techniques problem-solving
⮚ Group discussion on identifying base cases and breaking down
complex problems into recursive subproblems
⮚ Demonstration on solving complex problems using recursive algorithms
with examples
⮚ Practical exercise on implementing recursive solutions for various
problems, focusing on base cases and recursive calls
Formative ✔ Oral assessment
assessment ✔ Written assessment
✔ Practical assessment
methods /(CAT)
Integrated/Summative assessment (For specific module)

Integrated situation
Sudoku Solver

A Sudoku Solver is a program that can solve Sudoku puzzles, which are logic-based number-placement games.
Solving Sudoku puzzles involves applying constraint satisfaction techniques and can be a great exercise in
algorithmic problem-solving.

Project Components:

Sudoku Representation: Create data structures to represent Sudoku grids. A 9x9 matrix or a 2D array can be used to
hold the puzzle.

Input Handling: Implement a function to input Sudoku puzzles. You can read puzzles from a file or allow users to
input them interactively.

Constraint Checking: Develop algorithms to check whether a Sudoku puzzle is valid according to the rules (no
duplicate numbers in rows, columns, or 3x3 subgrids).

Backtracking Algorithm: Implement a backtracking algorithm (such as the famous "Sudoku-solving" algorithm) to
solve Sudoku puzzles. This algorithm tries different number placements and backtracks when necessary.

User Interface (Optional): If you want to make it more user-friendly, create a text-based interface that displays the
puzzle and the solution step by step.

Difficulty Levels (Optional): Extend the project by generating Sudoku puzzles of varying difficulty levels and
ensuring that the solver can handle them.

Resources
Tools GCC, Vscode…………………….

Equipment Computer……………………………..

Materials/ Consumables Reams of papers………………………..

Assessment criteria Observation Marks


Assessable
(Based on Indicator allocation
outcomes Yes No
performance criteria)
Learning 1.1 Complex problems Functions are properly 5 marks
with C++ are accurately created to address
outcome 1: specific problem
solved using functions
aspects.
based on their kind of
Apply C++ inputs. Functions used are 5 marks
programmin designed for easy
understanding and
g concepts. readability.
Functions demonstrate 5 marks
(30%) proficiency in handling
complex inputs and
producing accurate
outputs.
Proper Class and Object 5 marks
Design
1.2 Object-Oriented
Encapsulation and 2 marks
Programming is well Information Hiding
defined based on data Inheritance and
and behavior of the 5 marks
Polymorphism
object. Properly Defined Data 3 marks
Structures
Learning 2.1 Abstract Data Clear and accurate 5 marks
descriptions of abstract
outcome 2: Structures are properly data structures relevant
Analyse described based on to the problem solution.
solution to be Demonstrates 10 marks
data
implemented. understanding of how
structure chosen data structures
and align with the problem
requirements.
algorithms Illustrates knowledge of 5 marks
the strengths and
(30%) weaknesses of the
chosen data structures.
Effective utilization of 10 marks
algorithms in conjunction
with data structures for
problem-solving.
Learning 3.1 Array Elements are Demonstrates proficient 3 marks
manipulation of array
outcome 3:proficiently manipulated elements considering
based on linear data the principles of linear
data structures.
Implement structures Shows skill in handling 5 marks
Linear dynamic arrays where
Data applicable.
Utilizes advanced array 2 marks
Structure manipulation techniques
in problem-solving.
(30%) Effective application of 3 marks
3.2. Sorting and sorting algorithms
considering the nature of
searching algorithms are the array data structure.
efficiently applied based Proficient 2 marks
array data structure and implementation of
language constructs. searching algorithms in
alignment with array
structure and language
constructs.
Demonstrates 5 marks
adaptability in choosing
the appropriate algorithm
based on problem
requirements.
3.3 Stack is correctly Accurate implementation 3 marks
of a stack using arrays,
implemented using demonstrating
arrays and linked lists understanding of its
based on their application in data
application on the data structures..
structures Accurate implementation 5 marks
of a stack using linked
lists, showcasing
proficiency in data
structure application.
Identifies and explains 2 marks
the advantages and
disadvantages of using
arrays vs. linked lists for
implementing a stack.
4.1 Recursive function Demonstrates 2 marks
Learning proficiency in
outcome are properly implementing recursive
implemented in line with
4: functions to solve
data structure complex problems.
Apply manipulation techniques Recursive functions are 3 marks
recursion effectively integrated
with the chosen data
for solving structure manipulation
complex techniques.
problems Provides insightful 5 marks
comments/documentatio
using C++ n explaining the
(10%) recursive process and its
relation to data structure
manipulation.
Total marks
Percentage Weightage 100%
Minimum Passing line % (Aggregate): 70%

References:
Books:
1. "Data Structures and Algorithms in C++" by Adam Drozdek
2. "Problem Solving with Algorithms and Data Structures Using C++" by Hemant J
3. "C++ Data Structures and Algorithms" by Wisnu Anggoro
4. "Data Structures and Algorithm Analysis in C++" by Mark A. Weiss
5. "Problem Solving with Algorithms and Data Structures Using C++" by Bradley N.
Miller and David L. Ranum
6. "Data Structures Using C++" by Varsha H. Patil and Ashok N. Patil
7. "Data Structures and Program Design Using C++" by D. Malhotra and N. Malhotra
8. "Data Structures and Other Objects Using C++" by Michael Main and Walter Savitch
9. "Data Structures and Algorithm Analysis in C++" by Clifford A. Shaffer
10. "C++ Plus Data Structures" by Nell Dale and Chip Weems
11. "Data Structures and Algorithms Made Easy in C++" by Narasimha Karumanchi
Tutorials:

1. LinkedIn Learning –

Programming Foundations: Data Structures


Programming Foundations: Algorithms
C: Data Structures, Pointers, and File Systems

2. Udemy –

Mastering Data Structures & Algorithms using C and C++


Master the Coding Interview: Data Structures + Algorithms
Data Structure & Algorithm using C++ : Zero To Mastery 2023

3. Pluralsight –
An Introduction to Algorithmics
Algorithms and Data Structures - Part 1
Algorithms and Data Structures - Part 2

You might also like