Algorithm - Introduction

Madhu Bala
Madhu BalaAssistant Profesoor en TMM college of Arts and Sciene
 What is algorithm?
 Characteristics of algorithm
 Design method
ALGORITHM
 An algorithm is a finite set of instructions that if followed,
accomplishes a particular task.
 An input to an algorithm specifies an instance of the
problem.
 An algorithm can be specified in a natural language or
pseudo code.
 Algorithm can be implemented as computer programs.
algorithm
PROBLEM
ALGORITHM
COMPUTERINPUT OUTPUT
NOTATION OF ALGORITHM
 INPUT: zero or more quantities externally supplied.
 OUTPUT: at least one quantity is produced.
 DEFINITENESS: Each instruction is clear and ambiguous.
 FINITENESS: the algorithm terminates after a finite number of
steps.
 EFFICIENCY: every instruction must be very basic.
 UN AMBIGUITY: an algorithm must be expressed in a fashion
that is completely free for ambiguity.
Characteristics of algorithm
1. Understanding the problem.
2. Ascertaining the capabilities of computational device.
3. Choosing between exact and approximate problem solving.
4. Deciding the appropriate data structure.
5. Algorithm design techniques.
6. Method of specifying an algorithm.
7. Proving an algorithm’s correctness.
8. Analyzing an algorithm.
9. Coding an algorithm.
DESIGN METHODS
UNDERSTAND THE PROBLEM
DECIDING ON COMPUTATIONAL
EXACT VS APPOROXIMATE
DATA STRUCTURE
DESIGN TECHNIQUES
DESIGN AN ALGORITHM
PROVE CORRECTNESS
ANALYZE THE ALGORITHM
CODE THE ALGORITHM
 Reading the problem’s description carefully.
 Ask questions and clarify the doubt arise in the problem.
 Do some examples and the think about special cases.
 Divide the problem into smaller problems until it become
manageable size.
1.Understanding the problem
 In random access machine, instruction to be executed one
after another, one operation at a time.
 Algorithm designed to be executed on such machines are
called sequential algorithm.
 The central assumption of the RAM model does not called
for some new computers that can execute operations
concurrently. That is operation executed parallel.
 Algorithm that take the advantage of operations that
executed concurrently is called parallel algorithm
2.Ascertaing capabilities of a computational device
The next principal decision is to choose between solving the
problem exactly or solving the problem approximately.
 Exact algorithm: solve the problem exactly .
 Appropriate algorithm: solve the problem approximately.
3. Choosing between exact and approximate problem
solving
 Some problem can not be solved exactly
- extracting square root
- solving non linear equations
- evaluating definite integrals
 Exact algorithm can be slow because of the problem’s complexity.
- traveling salesman problem of finding the shortest path
through n cities
 It is a part of more sophisticated algorithm that solves a problem
exactly
BENEFITS OF
APPROXIMATE ALGORITHM
 defined as a particular scheme of organizing related data items.
 Algorithm + Data structure = Programs.
 Important for both design and analysis of algorithms
 Some algorithm do not demand any ingenuity is representing
their inputs.
 Some of the algorithm design techniques is used to structuring
or restricting data specifying a problem’s instance.
 The variability is algorithm is due to in which the data of
program are stored.
4.Deciding the appropriate data structure.
An algorithm design technique is a general approach to solving
problems algorithmically that is applicable to a variety of
problems from different areas of computing
Merits:
 Provide guidance for designing algorithms for new problem.
 Algorithm are the cornerstone of computer science.
 Used to classify the algorithm based on the design idea.
 can serve as a natural way to both categorize and study
algorithms.
5. algorithm design technique
There are three options that are most widely used for
specifying algorithms.
 Euclid’s algorithm
 Pseudo code
 Flow chart
6. METHOD OF SPECIFYING
AN ALGORITHM
1. Euclid’s algorithm:
 specified by simple English statement.
 step by step form
2. Flow chart:
 It is a method of expressing an algorithm by
diagrammatic representation.
 It is very simple.
6. METHOD OF SPECIFYING AN
ALGORITHM (Cont.)
3. Pseudo code:
 It is a mixture of natural language and programming
language constructs.
 It is move precise than a natural language.
 For simplicity, declaration of the variable omitted.
 For, if and while statements are used to show the scope
of variables.
 “  ” is used for assignment operation.
 “// ” is used for comments
6. METHOD OF SPECIFYING
AN ALGORITHM (cont.)
 Once an algorithm has been specified, then its correctness
must be proved.
 The algorithm yields a required result for every legitimate
input in a finite amount of time.
 Proving correctness - mathematical induction.
 In mathematical induction an algorithms iteration provide a
natural sequence of steps needs for proofs.
 The notation of correctness for approximation is less
straight forward than it is for exact algorithm
7.Proving an algorithm’s correctness
• Efficiency of an algorithm can be measured in terms of
space and time.
• Space:
The number of units, it requires for memory storage.
• Time:
The amount of time needed for executing an algorithm.
Complexity of an algorithm is measured by calculating
the time taken, space required for performing the algorithm.
8.Analyzing algorithms
 Once an algorithm has been selected, a 10-506 speed up may
be worth an effort.
 An algorithm’s optimally is not about the efficiency of an
algorithm but about the complexity of the problem.
 Another important issue of algorithmic problem solving is the
question of whether or not every problem can be solved by
algorithm.
9. Coding an algorithm
1 de 18

Más contenido relacionado

La actualidad más candente(20)

Unit 1. Problem Solving with Computer   Unit 1. Problem Solving with Computer
Unit 1. Problem Solving with Computer
Ashim Lamichhane35.3K vistas
Data Structures - Lecture 1 [introduction]Data Structures - Lecture 1 [introduction]
Data Structures - Lecture 1 [introduction]
Muhammad Hammad Waseem1.6K vistas
Design and Analysis of AlgorithmsDesign and Analysis of Algorithms
Design and Analysis of Algorithms
Arvind Krishnaa23.9K vistas
Asymptotic NotationsAsymptotic Notations
Asymptotic Notations
Rishabh Soni11.6K vistas
chapter 1chapter 1
chapter 1
yatheesha4.4K vistas
CPU Scheduling in OS  PresentationCPU Scheduling in OS  Presentation
CPU Scheduling in OS Presentation
usmankiyani15.3K vistas
Problem solving agentsProblem solving agents
Problem solving agents
Megha Sharma4.1K vistas
Data Structure and AlgorithmsData Structure and Algorithms
Data Structure and Algorithms
iqbalphy11.5K vistas
Graph algorithmGraph algorithm
Graph algorithm
University of Potsdam2.4K vistas
Complexity analysis in AlgorithmsComplexity analysis in Algorithms
Complexity analysis in Algorithms
Daffodil International University3.2K vistas
Backpropagation  algoBackpropagation  algo
Backpropagation algo
noT yeT woRkiNg !! iM stiLl stUdYinG !!10.7K vistas
Algorithms Lecture 7: Graph AlgorithmsAlgorithms Lecture 7: Graph Algorithms
Algorithms Lecture 7: Graph Algorithms
Benha University3.6K vistas
Artificial Intelligence: Knowledge AcquisitionArtificial Intelligence: Knowledge Acquisition
Artificial Intelligence: Knowledge Acquisition
The Integral Worm31.4K vistas
Algorithmic problem solvingAlgorithmic problem solving
Algorithmic problem solving
Prabhakaran V M5.3K vistas
AI: Logic in AIAI: Logic in AI
AI: Logic in AI
DataminingTools Inc11.6K vistas

Destacado(20)

Introduction To Algorithm [2]Introduction To Algorithm [2]
Introduction To Algorithm [2]
ecko_disasterz1.4K vistas
algorithmalgorithm
algorithm
kokilabe1.9K vistas
Introduction to AlgorithmIntroduction to Algorithm
Introduction to Algorithm
Education Front1.2K vistas
AlgorithmAlgorithm
Algorithm
Rakotoarison Louis Frederick589 vistas
Algorithm and Programming (Introduction of Algorithms)Algorithm and Programming (Introduction of Algorithms)
Algorithm and Programming (Introduction of Algorithms)
Adam Mukharil Bachtiar9.9K vistas
IEA DSM Task 24 Transport Panel at BECC conferenceIEA DSM Task 24 Transport Panel at BECC conference
IEA DSM Task 24 Transport Panel at BECC conference
SEA - Sustainable Energy Advice Ltd1.2K vistas
Core Management - Task 1Core Management - Task 1
Core Management - Task 1
🇳🇿Helen McGinty528 vistas
Technical product managerTechnical product manager
Technical product manager
Mark Long476 vistas
dockerdocker
docker
Cesar Maciel734 vistas
kafka-steaming-datakafka-steaming-data
kafka-steaming-data
Bryan Jacobs323 vistas
HTML5 로 iPhone App 만들기HTML5 로 iPhone App 만들기
HTML5 로 iPhone App 만들기
JungHyuk Kwon15.3K vistas

Similar a Algorithm - Introduction

Algorithm Analysis.pdfAlgorithm Analysis.pdf
Algorithm Analysis.pdfNayanChandak1
33 vistas58 diapositivas
Python algorithmPython algorithm
Python algorithmProf. Dr. K. Adisesha
398 vistas18 diapositivas

Similar a Algorithm - Introduction(20)

Introduction to Algorithms Complexity Analysis Introduction to Algorithms Complexity Analysis
Introduction to Algorithms Complexity Analysis
Dr. Pankaj Agarwal2.6K vistas
Algorithm Analysis.pdfAlgorithm Analysis.pdf
Algorithm Analysis.pdf
NayanChandak133 vistas
Python algorithmPython algorithm
Python algorithm
Prof. Dr. K. Adisesha398 vistas
Introduction to algorithmsIntroduction to algorithms
Introduction to algorithms
Madishetty Prathibha297 vistas
Algorithms notes 2   tutorials duniyaAlgorithms notes 2   tutorials duniya
Algorithms notes 2 tutorials duniya
TutorialsDuniya.com123 vistas
Daa chapter 1Daa chapter 1
Daa chapter 1
B.Kirron Reddi90 vistas
UNIT-1-PPTS-DAA.pptUNIT-1-PPTS-DAA.ppt
UNIT-1-PPTS-DAA.ppt
racha49357 vistas
UNIT-1-PPTS-DAA.pptUNIT-1-PPTS-DAA.ppt
UNIT-1-PPTS-DAA.ppt
SamridhiGulati45 vistas
Unit 1 dsaUnit 1 dsa
Unit 1 dsa
PUNE VIDYARTHI GRIHA'S COLLEGE OF ENGINEERING, NASHIK135 vistas
Unit 1, ADA.pptxUnit 1, ADA.pptx
Unit 1, ADA.pptx
jinkhatima13 vistas
DAA ppt.pptxDAA ppt.pptx
DAA ppt.pptx
RAJESH S18 vistas
DAA 1 ppt.pptxDAA 1 ppt.pptx
DAA 1 ppt.pptx
RAJESH S14 vistas
Algorithm analysis and efficiencyAlgorithm analysis and efficiency
Algorithm analysis and efficiency
ppts123456337 vistas
Introduction to algorithmsIntroduction to algorithms
Introduction to algorithms
subhashchandra197437 vistas

Más de Madhu Bala

Internet of Things (IoT)Internet of Things (IoT)
Internet of Things (IoT)Madhu Bala
231 vistas28 diapositivas
Digital logicDigital logic
Digital logicMadhu Bala
168 vistas25 diapositivas
Operating systemOperating system
Operating systemMadhu Bala
6.4K vistas15 diapositivas
Greedy Algorithm - Knapsack ProblemGreedy Algorithm - Knapsack Problem
Greedy Algorithm - Knapsack ProblemMadhu Bala
24.5K vistas15 diapositivas
Divide and conquer - Quick sortDivide and conquer - Quick sort
Divide and conquer - Quick sortMadhu Bala
5.9K vistas19 diapositivas

Más de Madhu Bala(10)

Internet of Things (IoT)Internet of Things (IoT)
Internet of Things (IoT)
Madhu Bala231 vistas
Digital logicDigital logic
Digital logic
Madhu Bala168 vistas
Operating systemOperating system
Operating system
Madhu Bala6.4K vistas
Greedy Algorithm - Knapsack ProblemGreedy Algorithm - Knapsack Problem
Greedy Algorithm - Knapsack Problem
Madhu Bala24.5K vistas
Divide and conquer - Quick sortDivide and conquer - Quick sort
Divide and conquer - Quick sort
Madhu Bala5.9K vistas
GPRS TechnologyGPRS Technology
GPRS Technology
Madhu Bala983 vistas
4G technology4G technology
4G technology
Madhu Bala225 vistas
Data structure - GraphData structure - Graph
Data structure - Graph
Madhu Bala6.2K vistas
Smoothing Filters in Spatial DomainSmoothing Filters in Spatial Domain
Smoothing Filters in Spatial Domain
Madhu Bala28.5K vistas

Último(20)

Pointers.pptxPointers.pptx
Pointers.pptx
Ananthi Palanisamy62 vistas
Codes and Conventions.pptxCodes and Conventions.pptx
Codes and Conventions.pptx
IsabellaGraceAnkers6 vistas
performance uploading.pptxperformance uploading.pptx
performance uploading.pptx
SanthiS107 vistas
cloud computing-virtualization.pptxcloud computing-virtualization.pptx
cloud computing-virtualization.pptx
RajaulKarim2078 vistas
String.pptxString.pptx
String.pptx
Ananthi Palanisamy47 vistas
IEC 61850 Technical Overview.pdfIEC 61850 Technical Overview.pdf
IEC 61850 Technical Overview.pdf
ssusereeea975 vistas
Electrical CrimpingElectrical Crimping
Electrical Crimping
Iwiss Tools Co.,Ltd19 vistas
Paper 3.pdfPaper 3.pdf
Paper 3.pdf
Javad Kadkhodapour6 vistas
Activated sludge process .pdfActivated sludge process .pdf
Activated sludge process .pdf
8832RafiyaAltaf6 vistas
LFA-NPG-Paper.pdfLFA-NPG-Paper.pdf
LFA-NPG-Paper.pdf
harinsrikanth40 vistas
Stone Masonry and Brick Masonry.pdfStone Masonry and Brick Masonry.pdf
Stone Masonry and Brick Masonry.pdf
Mohammed Abdullah Laskar19 vistas
CHI-SQUARE ( χ2) TESTS.pptxCHI-SQUARE ( χ2) TESTS.pptx
CHI-SQUARE ( χ2) TESTS.pptx
ssusera597c514 vistas
SEMI CONDUCTORSSEMI CONDUCTORS
SEMI CONDUCTORS
pavaniaalla200516 vistas

Algorithm - Introduction

  • 1.  What is algorithm?  Characteristics of algorithm  Design method ALGORITHM
  • 2.  An algorithm is a finite set of instructions that if followed, accomplishes a particular task.  An input to an algorithm specifies an instance of the problem.  An algorithm can be specified in a natural language or pseudo code.  Algorithm can be implemented as computer programs. algorithm
  • 4.  INPUT: zero or more quantities externally supplied.  OUTPUT: at least one quantity is produced.  DEFINITENESS: Each instruction is clear and ambiguous.  FINITENESS: the algorithm terminates after a finite number of steps.  EFFICIENCY: every instruction must be very basic.  UN AMBIGUITY: an algorithm must be expressed in a fashion that is completely free for ambiguity. Characteristics of algorithm
  • 5. 1. Understanding the problem. 2. Ascertaining the capabilities of computational device. 3. Choosing between exact and approximate problem solving. 4. Deciding the appropriate data structure. 5. Algorithm design techniques. 6. Method of specifying an algorithm. 7. Proving an algorithm’s correctness. 8. Analyzing an algorithm. 9. Coding an algorithm. DESIGN METHODS
  • 6. UNDERSTAND THE PROBLEM DECIDING ON COMPUTATIONAL EXACT VS APPOROXIMATE DATA STRUCTURE DESIGN TECHNIQUES DESIGN AN ALGORITHM PROVE CORRECTNESS ANALYZE THE ALGORITHM CODE THE ALGORITHM
  • 7.  Reading the problem’s description carefully.  Ask questions and clarify the doubt arise in the problem.  Do some examples and the think about special cases.  Divide the problem into smaller problems until it become manageable size. 1.Understanding the problem
  • 8.  In random access machine, instruction to be executed one after another, one operation at a time.  Algorithm designed to be executed on such machines are called sequential algorithm.  The central assumption of the RAM model does not called for some new computers that can execute operations concurrently. That is operation executed parallel.  Algorithm that take the advantage of operations that executed concurrently is called parallel algorithm 2.Ascertaing capabilities of a computational device
  • 9. The next principal decision is to choose between solving the problem exactly or solving the problem approximately.  Exact algorithm: solve the problem exactly .  Appropriate algorithm: solve the problem approximately. 3. Choosing between exact and approximate problem solving
  • 10.  Some problem can not be solved exactly - extracting square root - solving non linear equations - evaluating definite integrals  Exact algorithm can be slow because of the problem’s complexity. - traveling salesman problem of finding the shortest path through n cities  It is a part of more sophisticated algorithm that solves a problem exactly BENEFITS OF APPROXIMATE ALGORITHM
  • 11.  defined as a particular scheme of organizing related data items.  Algorithm + Data structure = Programs.  Important for both design and analysis of algorithms  Some algorithm do not demand any ingenuity is representing their inputs.  Some of the algorithm design techniques is used to structuring or restricting data specifying a problem’s instance.  The variability is algorithm is due to in which the data of program are stored. 4.Deciding the appropriate data structure.
  • 12. An algorithm design technique is a general approach to solving problems algorithmically that is applicable to a variety of problems from different areas of computing Merits:  Provide guidance for designing algorithms for new problem.  Algorithm are the cornerstone of computer science.  Used to classify the algorithm based on the design idea.  can serve as a natural way to both categorize and study algorithms. 5. algorithm design technique
  • 13. There are three options that are most widely used for specifying algorithms.  Euclid’s algorithm  Pseudo code  Flow chart 6. METHOD OF SPECIFYING AN ALGORITHM
  • 14. 1. Euclid’s algorithm:  specified by simple English statement.  step by step form 2. Flow chart:  It is a method of expressing an algorithm by diagrammatic representation.  It is very simple. 6. METHOD OF SPECIFYING AN ALGORITHM (Cont.)
  • 15. 3. Pseudo code:  It is a mixture of natural language and programming language constructs.  It is move precise than a natural language.  For simplicity, declaration of the variable omitted.  For, if and while statements are used to show the scope of variables.  “  ” is used for assignment operation.  “// ” is used for comments 6. METHOD OF SPECIFYING AN ALGORITHM (cont.)
  • 16.  Once an algorithm has been specified, then its correctness must be proved.  The algorithm yields a required result for every legitimate input in a finite amount of time.  Proving correctness - mathematical induction.  In mathematical induction an algorithms iteration provide a natural sequence of steps needs for proofs.  The notation of correctness for approximation is less straight forward than it is for exact algorithm 7.Proving an algorithm’s correctness
  • 17. • Efficiency of an algorithm can be measured in terms of space and time. • Space: The number of units, it requires for memory storage. • Time: The amount of time needed for executing an algorithm. Complexity of an algorithm is measured by calculating the time taken, space required for performing the algorithm. 8.Analyzing algorithms
  • 18.  Once an algorithm has been selected, a 10-506 speed up may be worth an effort.  An algorithm’s optimally is not about the efficiency of an algorithm but about the complexity of the problem.  Another important issue of algorithmic problem solving is the question of whether or not every problem can be solved by algorithm. 9. Coding an algorithm