SlideShare a Scribd company logo
Design And Analysis of AlgorithmsTopic #1:  Algorithm BasicsPrepared by:  BrijidaCharizma A. Navarro
IntroductionAs future computer scientists, you will usually more concerned with writing complex program algorithm.
AlgorithmsStep by step method of solving some problemsSolution that can be executed by a computerDerived from the name of the nith-century Persian mathematician al-Khowarizmi.
AlgorithmA  complete, step-by-step procedure for solving a specific problem.
Pakiisipnga…..Does the computer understand an algorithm?
Properties of AlgorithmsInputOutputPrecision
Properties of AlgorithmsDeterminismFiniteness CorrectnessGenerality
ExampleMake an algorithm that finds the maximum of three numbers a, b and c.
Algorithm:  Finding the maximum in a list of 3 numbersa = 1, b = 5,c = 3x = aIf b > x then x = bIf c > x, then x=c.
Two Main Tasks in the Study of AlgorithmsAlgorithm DesignAnalysis of Algorithms
Algorithm DesignTo solve problemsAn art more than a science
Analysis of AlgorithmsWill provide insights into designing new algorithms
in analysis of algorithms, we ask ourselves the following questions:Correctness.Given an algorithm for a problem, does it solve the problem?Termination.  Does the algorithm always stop after a finite number of steps?Time Analysis.  How many instructions does the algorithm execute?Space Analysis.  How much memory does the algorithm need to execute?
ExerciseWrite an algorithm that finds the smallest element among a, b and c
Solutionx = aIf b < x, then x = b.If c < x, then x = c.
2.  ExerciseWhich properties of an algorithm – input, output, precision, determinism, finiteness, correctness, generality – if any, are lacking in the following.  Explain.  The input is a set of S of integers and an integer m.  The output is all subsets of S that sum to m.
Here’s the algorithm:List all subsets of S and their sums.Proceed through the subsets listed in step 1 and output each whose sum is m.
Answer:If the set S is an infinite set, the algorithm will not terminate, so it lacks finiteness and output properties.Line 1 is not precisely stated since how to list the subsets of S and their sums is not specified; thus the algorithm lacks the precision property.The order of the subsets listed in line 1 depends on the method used to generate them, so the algorithm lacks the determinism property.Since line 2 depends on the order of the subsets generated in line 1, the determinism property is lacking here as well.
Pseudocode for AlgorithmsMade of ordinary languagePrecision, structure and universalityClosely resembles the actual code of computer languages such as C++ and JavaAny version of pseudocode is acceptable as long as the instructions are unambiguous.
Algorithm StructureAlgorithm:  Finding the Maximum of Three Numbers.  This algorithm finds the largest of the numbers a, b, and cInput Parameters:  a, b, cOutput Parameter: xmax(a,b,c){  x = a  if (b > x)  // b is larger than x, update x      x = b  if (c > x) // c is larger than x, update x      x = c}
TitleBrief description of the algorithmThe input and output parametersFunction containing the instructions of the algorithm
Do this…………Design an algorithm that will find the largest number in an array ss[1],s[2],…,s[n]Note:  an array is a group of data of the same typeUse while

More Related Content

PDF
Lecture 2 role of algorithms in computing
PPT
Fundamental of Algorithms
PDF
Design and analysis of algorithms
PPT
PPTX
Daa unit 1
PDF
ADA complete notes
PDF
Daa notes 1
PDF
Design and analysis of computer algorithms
Lecture 2 role of algorithms in computing
Fundamental of Algorithms
Design and analysis of algorithms
Daa unit 1
ADA complete notes
Daa notes 1
Design and analysis of computer algorithms

What's hot (19)

PDF
Design & Analysis of Algorithms Lecture Notes
PDF
Lecture 1 objective and course plan
PPTX
Design and analysis of algorithms - Abstract View
PPT
Design and Analysis of Algorithms
PPTX
Notion of an algorithm
PDF
Fundamentals of algorithms
PPTX
Daa unit 5
PDF
Algorithms Lecture 1: Introduction to Algorithms
PDF
Design & Analysis Of Algorithm
PDF
Algorithmic problem solving
PDF
01 Analysis of Algorithms: Introduction
PDF
Introduction to Algorithms Complexity Analysis
PPT
Algorithm Design Presentation
PPT
Model and Design
PPTX
Algorithm analysis (All in one)
PPT
Daa presentation 97
PDF
Daa notes 2
PPTX
Algorithms : Introduction and Analysis
PPT
Design and analysis of Algorithm By Dr. B. J. Mohite
Design & Analysis of Algorithms Lecture Notes
Lecture 1 objective and course plan
Design and analysis of algorithms - Abstract View
Design and Analysis of Algorithms
Notion of an algorithm
Fundamentals of algorithms
Daa unit 5
Algorithms Lecture 1: Introduction to Algorithms
Design & Analysis Of Algorithm
Algorithmic problem solving
01 Analysis of Algorithms: Introduction
Introduction to Algorithms Complexity Analysis
Algorithm Design Presentation
Model and Design
Algorithm analysis (All in one)
Daa presentation 97
Daa notes 2
Algorithms : Introduction and Analysis
Design and analysis of Algorithm By Dr. B. J. Mohite
Ad

Viewers also liked (8)

PPT
35 algorithm-types
PPTX
Lecture 2 data structures and algorithms
PPTX
Our presentation on algorithm design
PPTX
Insertion sort
PDF
C users_mpk7_app_data_local_temp_plugtmp_plugin-week3recursive
PPT
Introduction to Algorithms
PPTX
Dfs presentation
35 algorithm-types
Lecture 2 data structures and algorithms
Our presentation on algorithm design
Insertion sort
C users_mpk7_app_data_local_temp_plugtmp_plugin-week3recursive
Introduction to Algorithms
Dfs presentation
Ad

Similar to #1 designandanalysis of algo (20)

PDF
01 CS316_Introduction.pdf5959695559655565
PPTX
Algorithm in data structure bca .pptx
PDF
Algorithms
PPTX
Basic Algorithm @PPSC(1)
PPTX
Unit 2 algorithm
PPT
Introducción al Análisis y diseño de algoritmos
PPT
PPT
chapter 1
PPT
introegthnhhdfhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhppt
PPTX
1_Introduction.pptx
PDF
Algorithm Design and Analysis
PPTX
FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_I_25-07-2022_Fu...
PPT
Problem Solving Techniques notes for Unit 1
PPTX
ANALYSIS AND DESIGN OF ALGORITHMS -M1-PPT
PPT
data unit notes from department of computer science
PPT
daaadafrhdncxfbfbgdngfmfhmhagshh_unit_i.ppt
PPT
daa_unit THIS IS GNDFJG SDGSGS SFDF .ppt
PPSX
Ds03 part i algorithms by jyoti lakhani
PPTX
ADA_Module 1_MN.pptx- Analysis and design of Algorithms
PPTX
problem solving and algorithm development
01 CS316_Introduction.pdf5959695559655565
Algorithm in data structure bca .pptx
Algorithms
Basic Algorithm @PPSC(1)
Unit 2 algorithm
Introducción al Análisis y diseño de algoritmos
chapter 1
introegthnhhdfhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhppt
1_Introduction.pptx
Algorithm Design and Analysis
FALLSEM2022-23_BCSE202L_TH_VL2022230103292_Reference_Material_I_25-07-2022_Fu...
Problem Solving Techniques notes for Unit 1
ANALYSIS AND DESIGN OF ALGORITHMS -M1-PPT
data unit notes from department of computer science
daaadafrhdncxfbfbgdngfmfhmhagshh_unit_i.ppt
daa_unit THIS IS GNDFJG SDGSGS SFDF .ppt
Ds03 part i algorithms by jyoti lakhani
ADA_Module 1_MN.pptx- Analysis and design of Algorithms
problem solving and algorithm development

More from Brijida Charizma Ardoña-Navarro (9)

PDF
Business Analysis in the Workplace
PDF
Lesson6 usingandevaluatingmaterials
PDF
Lesson5 coneofexperience
PDF
Lesson1 meaningedtech
PDF
3 therolesofedtechinlearning
PPTX
PPTX
#1 designandanalysis of algo
PPT
E-Business First Chapter
Business Analysis in the Workplace
Lesson6 usingandevaluatingmaterials
Lesson5 coneofexperience
Lesson1 meaningedtech
3 therolesofedtechinlearning
#1 designandanalysis of algo
E-Business First Chapter

Recently uploaded (20)

PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Spectroscopy.pptx food analysis technology
PDF
Electronic commerce courselecture one. Pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
cuic standard and advanced reporting.pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Cloud computing and distributed systems.
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Approach and Philosophy of On baking technology
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
KodekX | Application Modernization Development
PPT
Teaching material agriculture food technology
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Spectroscopy.pptx food analysis technology
Electronic commerce courselecture one. Pdf
Unlocking AI with Model Context Protocol (MCP)
Advanced methodologies resolving dimensionality complications for autism neur...
cuic standard and advanced reporting.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Cloud computing and distributed systems.
Understanding_Digital_Forensics_Presentation.pptx
Programs and apps: productivity, graphics, security and other tools
Approach and Philosophy of On baking technology
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Network Security Unit 5.pdf for BCA BBA.
Agricultural_Statistics_at_a_Glance_2022_0.pdf
KodekX | Application Modernization Development
Teaching material agriculture food technology
“AI and Expert System Decision Support & Business Intelligence Systems”
Mobile App Security Testing_ A Comprehensive Guide.pdf

#1 designandanalysis of algo

  • 1. Design And Analysis of AlgorithmsTopic #1: Algorithm BasicsPrepared by: BrijidaCharizma A. Navarro
  • 2. IntroductionAs future computer scientists, you will usually more concerned with writing complex program algorithm.
  • 3. AlgorithmsStep by step method of solving some problemsSolution that can be executed by a computerDerived from the name of the nith-century Persian mathematician al-Khowarizmi.
  • 4. AlgorithmA complete, step-by-step procedure for solving a specific problem.
  • 5. Pakiisipnga…..Does the computer understand an algorithm?
  • 8. ExampleMake an algorithm that finds the maximum of three numbers a, b and c.
  • 9. Algorithm: Finding the maximum in a list of 3 numbersa = 1, b = 5,c = 3x = aIf b > x then x = bIf c > x, then x=c.
  • 10. Two Main Tasks in the Study of AlgorithmsAlgorithm DesignAnalysis of Algorithms
  • 11. Algorithm DesignTo solve problemsAn art more than a science
  • 12. Analysis of AlgorithmsWill provide insights into designing new algorithms
  • 13. in analysis of algorithms, we ask ourselves the following questions:Correctness.Given an algorithm for a problem, does it solve the problem?Termination. Does the algorithm always stop after a finite number of steps?Time Analysis. How many instructions does the algorithm execute?Space Analysis. How much memory does the algorithm need to execute?
  • 14. ExerciseWrite an algorithm that finds the smallest element among a, b and c
  • 15. Solutionx = aIf b < x, then x = b.If c < x, then x = c.
  • 16. 2. ExerciseWhich properties of an algorithm – input, output, precision, determinism, finiteness, correctness, generality – if any, are lacking in the following. Explain. The input is a set of S of integers and an integer m. The output is all subsets of S that sum to m.
  • 17. Here’s the algorithm:List all subsets of S and their sums.Proceed through the subsets listed in step 1 and output each whose sum is m.
  • 18. Answer:If the set S is an infinite set, the algorithm will not terminate, so it lacks finiteness and output properties.Line 1 is not precisely stated since how to list the subsets of S and their sums is not specified; thus the algorithm lacks the precision property.The order of the subsets listed in line 1 depends on the method used to generate them, so the algorithm lacks the determinism property.Since line 2 depends on the order of the subsets generated in line 1, the determinism property is lacking here as well.
  • 19. Pseudocode for AlgorithmsMade of ordinary languagePrecision, structure and universalityClosely resembles the actual code of computer languages such as C++ and JavaAny version of pseudocode is acceptable as long as the instructions are unambiguous.
  • 20. Algorithm StructureAlgorithm: Finding the Maximum of Three Numbers. This algorithm finds the largest of the numbers a, b, and cInput Parameters: a, b, cOutput Parameter: xmax(a,b,c){ x = a if (b > x) // b is larger than x, update x x = b if (c > x) // c is larger than x, update x x = c}
  • 21. TitleBrief description of the algorithmThe input and output parametersFunction containing the instructions of the algorithm
  • 22. Do this…………Design an algorithm that will find the largest number in an array ss[1],s[2],…,s[n]Note: an array is a group of data of the same typeUse while