Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
9 views

Introduction To Algorithm

dddddddddddddddddddd

Uploaded by

prasaths
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Introduction To Algorithm

dddddddddddddddddddd

Uploaded by

prasaths
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Introduction

to Algorithm
The word algorithm has a rich history, originating from
the name of a Persian mathematician, Abu Ja’far
Mohammed ibn Musa al Khowarizmi (c. 825 A.D.). He is
credited with providing the step-by-step rules for basic
arithmetic operations like addition, subtraction,
multiplication, and division. When written in Latin, his
name became Algorismus, from which the word algorithm
is derived. This term has gained significant importance in
computer science, where it refers to a method used by
computers to solve problems.
by S. PRASATH vetias
Early Algorithms
1 Euclid's Algorithm
Between 400 and 300 B.C., the renowned Greek mathematician Euclid
developed an algorithm for finding the greatest common divisor (gcd) of
two positive integers. This algorithm is a fundamental concept in number
theory and has applications in various fields, including cryptography and
computer science.

2 Al-Khwarizmi's Contributions
Al-Khwarizmi's work on arithmetic provided the foundation for the
development of algorithms. His step-by-step rules for basic arithmetic
operations laid the groundwork for the development of more complex
algorithms in later centuries.

3 Evolution of Algorithms
Over time, algorithms have evolved and become increasingly
sophisticated. The development of computers and programming languages
has enabled the creation of algorithms for solving a wide range of
problems, from simple tasks to complex scientific calculations.
What is an Algorithm?
Set of Steps
An algorithm is essentially a set of well-defined instructions that, when followed,
accomplish a specific task. These instructions are designed to be clear,
unambiguous, and finite, ensuring that the algorithm will always produce a
predictable outcome.

Computational Devices
Algorithms are often implemented on computers or other computational
devices. They provide a structured approach to solving problems, enabling
machines to perform tasks efficiently and accurately.

Everyday Examples
Algorithms are used in many aspects of our daily lives. For instance, GPS
systems use shortest path algorithms to find the optimal route, while online
shopping platforms rely on cryptography algorithms to secure transactions.
Algorithm Definition
Definition 1 Definition 2

An algorithm is a finite set of instructions that, An algorithm is a sequence of definite


if followed, accomplishes a particular task. It instructions for solving a problem. Algorithms
must satisfy the following criteria: that are definite and effective are also called
computational procedures. A program is the
• Input
expression of an algorithm in a programming
• Output language.
• Definiteness
• Finiteness
• Effectiveness
Problem Solving with Algorithms
Problem Definition
The first step in problem solving is to clearly define the problem. This involves identifying the
inputs, outputs, and constraints of the problem. For example, calculating the average of
grades for a given student requires defining the input as a list of grades and the output as
the average grade.
Algorithm Design
Once the problem is defined, the next step is to design an algorithm to solve it. This involves
describing the algorithm in a clear and concise manner, using natural language, pseudo-
code, diagrams, or other methods.

Algorithm Analysis
Algorithm analysis involves evaluating the efficiency of the algorithm in terms of time and
space complexity. Time complexity refers to the amount of time the algorithm takes to
execute, while space complexity refers to the amount of memory the algorithm requires.

Implementation
The implementation phase involves translating the algorithm into a programming language.
This requires choosing a suitable programming language, writing clean and well-documented
code, and ensuring that the code adheres to best practices.

Testing
Computer Algorithm
1 Procedure 2 Computational Complexity
A computer algorithm is a procedure, a finite The computational complexity of an
set of well-defined instructions, for algorithm is a measure of the resources,
accomplishing a specific task. It takes an such as time and memory, required to
initial state and, through a series of steps, execute it. Efficient implementation of an
transforms it into a defined end-state. algorithm is crucial for optimizing
performance and resource utilization.

3 Distinct Areas of Study 4 Testing Phases


Algorithm study encompasses various Testing a program involves two phases:
aspects, including developing algorithms, debugging and profiling. Debugging focuses
validating their correctness, analyzing their on identifying and correcting errors in the
performance, and testing their program, while profiling measures the
implementation. program's performance in terms of time and
space usage.
Algorithm Development Techniques

Divide & Conquer


This technique involves breaking down a problem into smaller subproblems that are
easier to solve. The solutions to the subproblems are then combined to solve the original
problem. Examples include merge sort and quick sort.

Branch and Bound


This technique is used for optimization problems. It systematically explores possible
solutions, pruning branches that are unlikely to lead to the optimal solution. Examples
include the traveling salesman problem and the knapsack problem.

Dynamic Programming
This technique is used to solve problems by breaking them down into overlapping
subproblems. The solutions to the subproblems are stored and reused to avoid
redundant calculations. Examples include the Fibonacci sequence and the shortest path
problem.
Algorithm Validation and
Analysis
Validation Analysis

Ensures that the algorithm Determines the time and


computes the correct answer space complexity of the
for all possible legal inputs. algorithm.

Involves testing the algorithm Uses mathematical tools and


with various inputs and techniques to analyze the
comparing the results to algorithm's performance.
expected outcomes.
Helps identify and correct Provides insights into the
errors in the algorithm. algorithm's efficiency and
scalability.

You might also like