SlideShare a Scribd company logo
4
Most read
8
Most read
9
Most read
ALGORITHM
Presented by
Amiya Bhusan Bagjadab
Asst. Prof.,
Department of CSE,
Radhakrisna Institute of
Technology and Engineering(RITE)
Contents
 Introduction
 Characteristics of an Algorithm
 Algorithm development process
 Basic Steps For Designing Algorithm
 Some Examples
Introduction
 An algorithm is a sequence of
unambiguous instructions for solving a
problem, i.e., for obtaining a required
output for any legitimate input in a
finite amount of time.
 Algorithm is a step-by-step procedure,
which defines a set of instructions to
be executed in a certain order to get
the desired output.
 Algorithm is any well defined
computational procedure that takes
some value or set of values as input
and produces some value or set of
values as output.
Characteristics of an Algorithm
 Unambiguous − Algorithm should be clear and unambiguous.
Each of its steps (or phases), and their inputs/outputs should be
clear and must lead to only one meaning.
 Input − An algorithm should have 1 or more well-defined inputs.
 Output − An algorithm should have 1 or more well-defined
outputs, and should match the desired output.
 Finiteness − Algorithms must terminate after a finite number of
steps.
 Feasibility − Should be feasible with the available resources.
 Independent − An algorithm should have step-by-step
directions, which should be independent of any programming
code.
Algorithm development process
 Our algorithm development process consists of five
major steps.
Step 1: Obtain a description of the problem.
Step 2: Analyze the problem.
Step 3: Develop a high-level algorithm.
Step 4: Refine the algorithm by adding more detail.
Step 5: Review the algorithm.
Basic Steps For Designing Algorithm
 Step 1 − START
 Step 2 −Take Input Variables
 Step 3 −Develop Logics
 Step 4 − Print the Output
 Step 5 − STOP
Design an algorithm to add two
numbers and display the result.
 Step 1 − START
 Step 2 − declare three integers a, b & c
 Step 3 − define values of a & b
 Step 4 − add values of a & b
 Step 5 − store output of step 4 to c
 Step 6 − print c
 Step 7 − STOP
Find the largest number among
three different numbers
 Step 1: Start
 Step 2: Declare variables a,b and c.
 Step 3: Read variables a,b and c.
 Step 4: If a > b
If a > c
Display a is the largest number.
Else Display c is the largest number.
Else
If b > c
Display b is the largest number.
Else Display c is the greatest number.
Step 5: Stop
Factorial of a number entered by the
user.
 Step 1: Start
 Step 2: Declare variables n, factorial and i.
 Step 3: Initialize variables
factorial ← 1
i ← 1
 Step 4: Read value of n
 Step 5: Repeat the steps until i = n
5.1: factorial ← factorial*i
5.2: i ← i+1
Step 6: Display factorial
Step 7: Stop
Check whether a number is a
prime number or not
 Step 1: Start
 Step 2: Declare variables n, i, flag.
 Step 3: Initialize variables
flag ← 1
i ← 2
 Step 4: Read n from the user.
 Step 5: Repeat the steps until i=(n/2)
5.1 If remainder of n÷i equals 0
flag ← 0
Go to step 6
5.2 i ← i+1
Step 6: If flag = 0
Display n is not prime
else
Display n is prime
Step 7: Stop
Basic Algorithm @PPSC(1)

More Related Content

PPSX
Algorithm and flowchart
PPTX
Our presentation on algorithm design
PPTX
Algorithm
PPTX
Application of numerical method
PPTX
Algorithm and flowchart
PPTX
Approximation and error
PPTX
Algorithm and flowchart
PPTX
Algorithm and flowchart
Algorithm and flowchart
Our presentation on algorithm design
Algorithm
Application of numerical method
Algorithm and flowchart
Approximation and error
Algorithm and flowchart
Algorithm and flowchart

What's hot (20)

PPT
Fundamentals of the Analysis of Algorithm Efficiency
PPTX
Applications of numerical methods
PPTX
Algorithms and flowcharts
PPT
Fundamental Programming Lect 2
PPTX
1.10. pumping lemma for regular sets
PPTX
presentation of make a calendar in c language.
PDF
Lecture 2 role of algorithms in computing
PPTX
Algorithm and Flowcharts
PPT
Unit 3 Foc
PPT
Best Techniques To Design Programs - Program Designing Techniques
PPT
Shading
PPTX
parallelization strategy
PPTX
CRT (Cathode ray tube)
PPT
Introduction To Algorithms.ppt
PPT
Fundamental of Algorithms
PPTX
Propositional logic
PPT
PPTX
Algorithms and Flowcharts
PPTX
ppt of flowchart
Fundamentals of the Analysis of Algorithm Efficiency
Applications of numerical methods
Algorithms and flowcharts
Fundamental Programming Lect 2
1.10. pumping lemma for regular sets
presentation of make a calendar in c language.
Lecture 2 role of algorithms in computing
Algorithm and Flowcharts
Unit 3 Foc
Best Techniques To Design Programs - Program Designing Techniques
Shading
parallelization strategy
CRT (Cathode ray tube)
Introduction To Algorithms.ppt
Fundamental of Algorithms
Propositional logic
Algorithms and Flowcharts
ppt of flowchart
Ad

Similar to Basic Algorithm @PPSC(1) (20)

PPTX
UNIT 1.pptx
PPTX
01 Introduction to analysis of Algorithms.pptx
PPTX
Data structures algorithms basics
PPT
UNIT-1-PPT-DESIGN AND ANALYSIS OF ALGORITHMS
PPT
UNIT-2-PPTS-DAA.ppt
PDF
Logic Development and Algorithm.
PPTX
Unit 1(1).pptx Program Logic Development
PPT
UNIT-1-PPTS-DAA.ppt
PPT
Introduction to Design Algorithm And Analysis.ppt
PPT
UNIT-1-PPTS-DAA.ppt
PPT
UNIT-1-PPTS-DAA INTRO WITH DIVIDE AND CONQUER
PPT
UNIT 1- Design Analysis of algorithms and its working
PPT
UNIT-1-PPTS-DAA_INTRODUCTION_TO_DAA_GH.ppt
PPTX
EXPLAINS ABOUT ALGORITHM and FLOWCHART.pptx
PPT
Problem Solving Techniques notes for Unit 1
PPTX
UNIT 1.pptx Programming for Problem Solving
PPT
AOA Week 01.ppt
PDF
UNIT-1-PdjfjfjfjfjfjfjfjfjfjfjPTS-DAA.pdf
PDF
UNIT-1-PPTS-DAA_cofjfjvjcjcncnfncmpressed.pdf
PPTX
Algorithm for computational problematic sit
UNIT 1.pptx
01 Introduction to analysis of Algorithms.pptx
Data structures algorithms basics
UNIT-1-PPT-DESIGN AND ANALYSIS OF ALGORITHMS
UNIT-2-PPTS-DAA.ppt
Logic Development and Algorithm.
Unit 1(1).pptx Program Logic Development
UNIT-1-PPTS-DAA.ppt
Introduction to Design Algorithm And Analysis.ppt
UNIT-1-PPTS-DAA.ppt
UNIT-1-PPTS-DAA INTRO WITH DIVIDE AND CONQUER
UNIT 1- Design Analysis of algorithms and its working
UNIT-1-PPTS-DAA_INTRODUCTION_TO_DAA_GH.ppt
EXPLAINS ABOUT ALGORITHM and FLOWCHART.pptx
Problem Solving Techniques notes for Unit 1
UNIT 1.pptx Programming for Problem Solving
AOA Week 01.ppt
UNIT-1-PdjfjfjfjfjfjfjfjfjfjfjPTS-DAA.pdf
UNIT-1-PPTS-DAA_cofjfjvjcjcncnfncmpressed.pdf
Algorithm for computational problematic sit
Ad

Recently uploaded (20)

PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
web development for engineering and engineering
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PPT
Mechanical Engineering MATERIALS Selection
PDF
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
PPTX
Geodesy 1.pptx...............................................
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PDF
Well-logging-methods_new................
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PDF
PPT on Performance Review to get promotions
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPTX
Current and future trends in Computer Vision.pptx
UNIT-1 - COAL BASED THERMAL POWER PLANTS
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
web development for engineering and engineering
R24 SURVEYING LAB MANUAL for civil enggi
Mechanical Engineering MATERIALS Selection
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
Geodesy 1.pptx...............................................
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
Well-logging-methods_new................
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Internet of Things (IOT) - A guide to understanding
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PPT on Performance Review to get promotions
CYBER-CRIMES AND SECURITY A guide to understanding
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Current and future trends in Computer Vision.pptx

Basic Algorithm @PPSC(1)

  • 1. ALGORITHM Presented by Amiya Bhusan Bagjadab Asst. Prof., Department of CSE, Radhakrisna Institute of Technology and Engineering(RITE)
  • 2. Contents  Introduction  Characteristics of an Algorithm  Algorithm development process  Basic Steps For Designing Algorithm  Some Examples
  • 3. Introduction  An algorithm is a sequence of unambiguous instructions for solving a problem, i.e., for obtaining a required output for any legitimate input in a finite amount of time.  Algorithm is a step-by-step procedure, which defines a set of instructions to be executed in a certain order to get the desired output.  Algorithm is any well defined computational procedure that takes some value or set of values as input and produces some value or set of values as output.
  • 4. Characteristics of an Algorithm  Unambiguous − Algorithm should be clear and unambiguous. Each of its steps (or phases), and their inputs/outputs should be clear and must lead to only one meaning.  Input − An algorithm should have 1 or more well-defined inputs.  Output − An algorithm should have 1 or more well-defined outputs, and should match the desired output.  Finiteness − Algorithms must terminate after a finite number of steps.  Feasibility − Should be feasible with the available resources.  Independent − An algorithm should have step-by-step directions, which should be independent of any programming code.
  • 5. Algorithm development process  Our algorithm development process consists of five major steps. Step 1: Obtain a description of the problem. Step 2: Analyze the problem. Step 3: Develop a high-level algorithm. Step 4: Refine the algorithm by adding more detail. Step 5: Review the algorithm.
  • 6. Basic Steps For Designing Algorithm  Step 1 − START  Step 2 −Take Input Variables  Step 3 −Develop Logics  Step 4 − Print the Output  Step 5 − STOP
  • 7. Design an algorithm to add two numbers and display the result.  Step 1 − START  Step 2 − declare three integers a, b & c  Step 3 − define values of a & b  Step 4 − add values of a & b  Step 5 − store output of step 4 to c  Step 6 − print c  Step 7 − STOP
  • 8. Find the largest number among three different numbers  Step 1: Start  Step 2: Declare variables a,b and c.  Step 3: Read variables a,b and c.  Step 4: If a > b If a > c Display a is the largest number. Else Display c is the largest number. Else If b > c Display b is the largest number. Else Display c is the greatest number. Step 5: Stop
  • 9. Factorial of a number entered by the user.  Step 1: Start  Step 2: Declare variables n, factorial and i.  Step 3: Initialize variables factorial ← 1 i ← 1  Step 4: Read value of n  Step 5: Repeat the steps until i = n 5.1: factorial ← factorial*i 5.2: i ← i+1 Step 6: Display factorial Step 7: Stop
  • 10. Check whether a number is a prime number or not  Step 1: Start  Step 2: Declare variables n, i, flag.  Step 3: Initialize variables flag ← 1 i ← 2  Step 4: Read n from the user.  Step 5: Repeat the steps until i=(n/2) 5.1 If remainder of n÷i equals 0 flag ← 0 Go to step 6 5.2 i ← i+1 Step 6: If flag = 0 Display n is not prime else Display n is prime Step 7: Stop