Lecture 3 - Algorithms Functions
Lecture 3 - Algorithms Functions
• Help in small tasks like adding two numbers, to complex systems like sorting data or
machine learning models.
Algorithm
1. Start
2. Read side length a
3. Read side length b
4. Area = a * b
5. Print area
6. Stop
Program:
• A program is a set of instructions written in a specific programming language to perform a task
or solve a problem.
• Programs are the building blocks of all software applications, from simple tools like calculators
to complex systems like operating systems
Difference between Algorithm & Program
An algorithm is an abstract concept for solving a problem, whereas a program is the
actual implementation of that algorithm in a specific programming language.
Function
A function is a group of related statements that work together to complete a
particular job.
Calling function:
Result:
30
Modules, Packages, Libraries and Framework
Functions Module 1
Objects Module 3
Modules are used to pack and organize Packages are used to pack and organize
your functions, classes and other code related modules within a project.
objects.
Package 1 Library 1
Library 1 Library 2
Package 2 Framework
Package 3 Library 3
Packages are grouped together to form a Frameworks are used when you are
library within a project. developing a larger application or system.
Artificial Intelligence & Machine Learning
Algorithms -The Foundation in AI/ML:
Algorithms are used to analyze data, identify patterns, and make predictions or decisions.
Examples:
•Classification, regression, clustering, and reinforcement learning are common algorithm types.