SlideShare une entreprise Scribd logo
1  sur  14
UNIT 2
Algorithm and Flowcharts
8/2/20171 Ms SURBHI SAROHA(Asst.Professor)
Algorithm
 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. Algorithms are generally
created independent of underlying languages, i.e. an algorithm can be
implemented in more than one programming language.
 From the data structure point of view, following are some important categories
of algorithms −
 Search − Algorithm to search an item in a data structure.
 Sort − Algorithm to sort items in a certain order.
 Insert − Algorithm to insert item in a data structure.
 Update − Algorithm to update an existing item in a data structure.
 Delete − Algorithm to delete an existing item from a data structure.
8/2/20172 Ms SURBHI SAROHA(Asst.Professor)
Advantages of Algorithm
8/2/2017Ms SURBHI SAROHA(Asst.Professor)3
 It is a step-by-step repetition of a solution to a
given problem which is very easy to understand.
 Its easy to first develop an algorithm, then convert
it into a flowchart &then into a computer program.
 Its is easy to debug as every step is got its own
logical sequence.
Disadvantages of algorithm.
8/2/2017Ms SURBHI SAROHA(Asst.Professor)4
 Writing algorithm takes a long time.
 An Algorithm is not a computer program, it is
rather a concept of how a program should be.
Characteristics of an Algorithm
8/2/2017Ms SURBHI SAROHA(Asst.Professor)5
 An algorithm should have the following characteristics −
 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 0 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.
Example of Algorithm
8/2/2017Ms SURBHI SAROHA(Asst.Professor)6
 Let's try to learn algorithm-writing by using an
example.
 Problem− Design an algorithm to add two
numbers
 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
Cont….
8/2/2017Ms SURBHI SAROHA(Asst.Professor)7
 Algorithms tell the programmers how to code the
program. Alternatively, the algorithm can be
written as −
 Step 1 − START ADD
 Step 2 − get values of a & b
 Step 3 − c ← a + b
 Step 4 − display c
 Step 5 − STOP
Flowchart
8/2/2017Ms SURBHI SAROHA(Asst.Professor)8
 A flowchart is a picture (graphical representation) of
the problem solving process.
 A flowchart gives a step-by-step procedure for
solution of a problem.
 Elements of a flowchart:
 Various geometrical shaped boxes represent the
steps of the solution.
 The boxes are connected by directional arrows to
show the flow of the solution.
 Uses of a flowchart:
 To specify the method of solving a problem.
 To plan the sequence of a computer program.
 Communicate ideas, solutions.
Advantages Of Using
FLOWCHARTS
8/2/2017Ms SURBHI SAROHA(Asst.Professor)9
1.Communication: Flowcharts are better way of
communicating the logic of a system to all concerned
or involved.
2.Effective analysis: With the help of flowchart,
problem can be analyzed in more effective way
therefore reducing cost and wastage of time.
3.Proper documentation: Program flowcharts serve
as a good program documentation, which is needed
for various purposes, making things more efficient.
4.Efficient Coding: The flowcharts act as a guide or
blueprint during the systems analysis and program
development phase.
5.Proper Debugging: The flowchart helps in
debugging process.
6.Efficient Program Maintenance: The maintenance
of operating program becomes easy with the help of
flowchart. It helps the programmer to put efforts more
efficiently on that part
Disadvantages Of Using
FLOWCHARTS:
8/2/2017Ms SURBHI SAROHA(Asst.Professor)10
1. Complex logic: Sometimes, the program logic
is quite complicated. In that case, flowchart
becomes complex and clumsy. This will become a
pain for the user, resulting in a waste of time and
money trying to correct the problem.
2. Alterations and Modifications: If alterations
are required the flowchart may require re-drawing
completely. This will usually waste valuable time.
3.Reproduction: As the flowchart symbols
cannot be typed, reproduction of flowchart
becomes a problem.
8/2/2017Ms SURBHI SAROHA(Asst.Professor)11
8/2/2017Ms SURBHI SAROHA(Asst.Professor)12
8/2/2017Ms SURBHI SAROHA(Asst.Professor)13
Thank you
8/2/2017Ms SURBHI SAROHA(Asst.Professor)14

Contenu connexe

Tendances

Language processors
Language processorsLanguage processors
Language processors
eShikshak
 
1.1 The nature of software.ppt
1.1 The nature of software.ppt1.1 The nature of software.ppt
1.1 The nature of software.ppt
JAYAPRIYAR7
 

Tendances (20)

Algorithm
AlgorithmAlgorithm
Algorithm
 
Algorithm Introduction
Algorithm IntroductionAlgorithm Introduction
Algorithm Introduction
 
phases of algorithm
phases of algorithmphases of algorithm
phases of algorithm
 
Translators(Compiler, Assembler) and interpreter
Translators(Compiler, Assembler) and interpreterTranslators(Compiler, Assembler) and interpreter
Translators(Compiler, Assembler) and interpreter
 
Introduction to Algorithms & flow charts
Introduction to Algorithms & flow chartsIntroduction to Algorithms & flow charts
Introduction to Algorithms & flow charts
 
Language processors
Language processorsLanguage processors
Language processors
 
Algorithm Design & Implementation
Algorithm Design & ImplementationAlgorithm Design & Implementation
Algorithm Design & Implementation
 
Algorithms and Flowcharts
Algorithms and FlowchartsAlgorithms and Flowcharts
Algorithms and Flowcharts
 
Data structure ppt
Data structure pptData structure ppt
Data structure ppt
 
Introduction to programming
Introduction to programmingIntroduction to programming
Introduction to programming
 
Introduction to flowchart
Introduction to flowchartIntroduction to flowchart
Introduction to flowchart
 
Unit 1 - Introduction to Software Engineering.ppt
Unit 1 - Introduction to Software Engineering.pptUnit 1 - Introduction to Software Engineering.ppt
Unit 1 - Introduction to Software Engineering.ppt
 
Graph in data structure
Graph in data structureGraph in data structure
Graph in data structure
 
Algorithms, flow charts and pseudocodes
Algorithms, flow charts and pseudocodesAlgorithms, flow charts and pseudocodes
Algorithms, flow charts and pseudocodes
 
1.1 The nature of software.ppt
1.1 The nature of software.ppt1.1 The nature of software.ppt
1.1 The nature of software.ppt
 
Program development cyle
Program development cyleProgram development cyle
Program development cyle
 
Problem solving using Computer
Problem solving using ComputerProblem solving using Computer
Problem solving using Computer
 
Introduction to c++ ppt 1
Introduction to c++ ppt 1Introduction to c++ ppt 1
Introduction to c++ ppt 1
 
Pseudocode
PseudocodePseudocode
Pseudocode
 
Programming flowcharts for C Language
Programming flowcharts for C LanguageProgramming flowcharts for C Language
Programming flowcharts for C Language
 

Similaire à Algorithm and Flowcharts

COMPUTING AND PROGRAMMING FUNDAMENTAL.pptx
COMPUTING AND PROGRAMMING FUNDAMENTAL.pptxCOMPUTING AND PROGRAMMING FUNDAMENTAL.pptx
COMPUTING AND PROGRAMMING FUNDAMENTAL.pptx
SherinRappai
 

Similaire à Algorithm and Flowcharts (20)

What is algorithm
What is algorithmWhat is algorithm
What is algorithm
 
PCCF UNIT 1.pptx
PCCF UNIT 1.pptxPCCF UNIT 1.pptx
PCCF UNIT 1.pptx
 
Unit 1 python (2021 r)
Unit 1 python (2021 r)Unit 1 python (2021 r)
Unit 1 python (2021 r)
 
pccf unit 1 _VP.pptx
pccf unit 1 _VP.pptxpccf unit 1 _VP.pptx
pccf unit 1 _VP.pptx
 
lecture 5
 lecture 5 lecture 5
lecture 5
 
Introduction to computer science
Introduction to computer scienceIntroduction to computer science
Introduction to computer science
 
Introduction to problem solving in C
Introduction to problem solving in CIntroduction to problem solving in C
Introduction to problem solving in C
 
Algorithm-Introduction ,Characterestics & Control Structures.pdf
Algorithm-Introduction ,Characterestics & Control Structures.pdfAlgorithm-Introduction ,Characterestics & Control Structures.pdf
Algorithm-Introduction ,Characterestics & Control Structures.pdf
 
Introduction to Programming.docx
Introduction to Programming.docxIntroduction to Programming.docx
Introduction to Programming.docx
 
COMPUTING AND PROGRAMMING FUNDAMENTAL.pptx
COMPUTING AND PROGRAMMING FUNDAMENTAL.pptxCOMPUTING AND PROGRAMMING FUNDAMENTAL.pptx
COMPUTING AND PROGRAMMING FUNDAMENTAL.pptx
 
COMPUTING AND PROGRAMMING FUNDAMENTAL.pptx
COMPUTING AND PROGRAMMING FUNDAMENTAL.pptxCOMPUTING AND PROGRAMMING FUNDAMENTAL.pptx
COMPUTING AND PROGRAMMING FUNDAMENTAL.pptx
 
Data structures algorithms basics
Data structures   algorithms basicsData structures   algorithms basics
Data structures algorithms basics
 
Problem-solving and design 1.pptx
Problem-solving and design 1.pptxProblem-solving and design 1.pptx
Problem-solving and design 1.pptx
 
Module 1 python.pptx
Module 1 python.pptxModule 1 python.pptx
Module 1 python.pptx
 
PDLC.pptx
PDLC.pptxPDLC.pptx
PDLC.pptx
 
Algorithm & Flowchart.pdf
Algorithm & Flowchart.pdfAlgorithm & Flowchart.pdf
Algorithm & Flowchart.pdf
 
Algorithm and flowchart2010
Algorithm and flowchart2010Algorithm and flowchart2010
Algorithm and flowchart2010
 
Flow charts
Flow chartsFlow charts
Flow charts
 
Problem solving methodology
Problem solving methodologyProblem solving methodology
Problem solving methodology
 
Program concep sequential statements
Program concep sequential statementsProgram concep sequential statements
Program concep sequential statements
 

Plus de SURBHI SAROHA (20)

Cloud Computing (Infrastructure as a Service)UNIT 2
Cloud Computing (Infrastructure as a Service)UNIT 2Cloud Computing (Infrastructure as a Service)UNIT 2
Cloud Computing (Infrastructure as a Service)UNIT 2
 
Management Information System(Unit 2).pptx
Management Information System(Unit 2).pptxManagement Information System(Unit 2).pptx
Management Information System(Unit 2).pptx
 
Searching in Data Structure(Linear search and Binary search)
Searching in Data Structure(Linear search and Binary search)Searching in Data Structure(Linear search and Binary search)
Searching in Data Structure(Linear search and Binary search)
 
Management Information System(UNIT 1).pptx
Management Information System(UNIT 1).pptxManagement Information System(UNIT 1).pptx
Management Information System(UNIT 1).pptx
 
Introduction to Cloud Computing(UNIT 1).pptx
Introduction to Cloud Computing(UNIT 1).pptxIntroduction to Cloud Computing(UNIT 1).pptx
Introduction to Cloud Computing(UNIT 1).pptx
 
JAVA (UNIT 5)
JAVA (UNIT 5)JAVA (UNIT 5)
JAVA (UNIT 5)
 
DBMS (UNIT 5)
DBMS (UNIT 5)DBMS (UNIT 5)
DBMS (UNIT 5)
 
DBMS UNIT 4
DBMS UNIT 4DBMS UNIT 4
DBMS UNIT 4
 
JAVA(UNIT 4)
JAVA(UNIT 4)JAVA(UNIT 4)
JAVA(UNIT 4)
 
OOPs & C++(UNIT 5)
OOPs & C++(UNIT 5)OOPs & C++(UNIT 5)
OOPs & C++(UNIT 5)
 
OOPS & C++(UNIT 4)
OOPS & C++(UNIT 4)OOPS & C++(UNIT 4)
OOPS & C++(UNIT 4)
 
DBMS UNIT 3
DBMS UNIT 3DBMS UNIT 3
DBMS UNIT 3
 
JAVA (UNIT 3)
JAVA (UNIT 3)JAVA (UNIT 3)
JAVA (UNIT 3)
 
Keys in dbms(UNIT 2)
Keys in dbms(UNIT 2)Keys in dbms(UNIT 2)
Keys in dbms(UNIT 2)
 
DBMS (UNIT 2)
DBMS (UNIT 2)DBMS (UNIT 2)
DBMS (UNIT 2)
 
JAVA UNIT 2
JAVA UNIT 2JAVA UNIT 2
JAVA UNIT 2
 
Database Management System(UNIT 1)
Database Management System(UNIT 1)Database Management System(UNIT 1)
Database Management System(UNIT 1)
 
Object-Oriented Programming with Java UNIT 1
Object-Oriented Programming with Java UNIT 1Object-Oriented Programming with Java UNIT 1
Object-Oriented Programming with Java UNIT 1
 
Database Management System(UNIT 1)
Database Management System(UNIT 1)Database Management System(UNIT 1)
Database Management System(UNIT 1)
 
OOPs & C++ UNIT 3
OOPs & C++ UNIT 3OOPs & C++ UNIT 3
OOPs & C++ UNIT 3
 

Dernier

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Dernier (20)

On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 

Algorithm and Flowcharts

  • 1. UNIT 2 Algorithm and Flowcharts 8/2/20171 Ms SURBHI SAROHA(Asst.Professor)
  • 2. Algorithm  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. Algorithms are generally created independent of underlying languages, i.e. an algorithm can be implemented in more than one programming language.  From the data structure point of view, following are some important categories of algorithms −  Search − Algorithm to search an item in a data structure.  Sort − Algorithm to sort items in a certain order.  Insert − Algorithm to insert item in a data structure.  Update − Algorithm to update an existing item in a data structure.  Delete − Algorithm to delete an existing item from a data structure. 8/2/20172 Ms SURBHI SAROHA(Asst.Professor)
  • 3. Advantages of Algorithm 8/2/2017Ms SURBHI SAROHA(Asst.Professor)3  It is a step-by-step repetition of a solution to a given problem which is very easy to understand.  Its easy to first develop an algorithm, then convert it into a flowchart &then into a computer program.  Its is easy to debug as every step is got its own logical sequence.
  • 4. Disadvantages of algorithm. 8/2/2017Ms SURBHI SAROHA(Asst.Professor)4  Writing algorithm takes a long time.  An Algorithm is not a computer program, it is rather a concept of how a program should be.
  • 5. Characteristics of an Algorithm 8/2/2017Ms SURBHI SAROHA(Asst.Professor)5  An algorithm should have the following characteristics −  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 0 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.
  • 6. Example of Algorithm 8/2/2017Ms SURBHI SAROHA(Asst.Professor)6  Let's try to learn algorithm-writing by using an example.  Problem− Design an algorithm to add two numbers  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
  • 7. Cont…. 8/2/2017Ms SURBHI SAROHA(Asst.Professor)7  Algorithms tell the programmers how to code the program. Alternatively, the algorithm can be written as −  Step 1 − START ADD  Step 2 − get values of a & b  Step 3 − c ← a + b  Step 4 − display c  Step 5 − STOP
  • 8. Flowchart 8/2/2017Ms SURBHI SAROHA(Asst.Professor)8  A flowchart is a picture (graphical representation) of the problem solving process.  A flowchart gives a step-by-step procedure for solution of a problem.  Elements of a flowchart:  Various geometrical shaped boxes represent the steps of the solution.  The boxes are connected by directional arrows to show the flow of the solution.  Uses of a flowchart:  To specify the method of solving a problem.  To plan the sequence of a computer program.  Communicate ideas, solutions.
  • 9. Advantages Of Using FLOWCHARTS 8/2/2017Ms SURBHI SAROHA(Asst.Professor)9 1.Communication: Flowcharts are better way of communicating the logic of a system to all concerned or involved. 2.Effective analysis: With the help of flowchart, problem can be analyzed in more effective way therefore reducing cost and wastage of time. 3.Proper documentation: Program flowcharts serve as a good program documentation, which is needed for various purposes, making things more efficient. 4.Efficient Coding: The flowcharts act as a guide or blueprint during the systems analysis and program development phase. 5.Proper Debugging: The flowchart helps in debugging process. 6.Efficient Program Maintenance: The maintenance of operating program becomes easy with the help of flowchart. It helps the programmer to put efforts more efficiently on that part
  • 10. Disadvantages Of Using FLOWCHARTS: 8/2/2017Ms SURBHI SAROHA(Asst.Professor)10 1. Complex logic: Sometimes, the program logic is quite complicated. In that case, flowchart becomes complex and clumsy. This will become a pain for the user, resulting in a waste of time and money trying to correct the problem. 2. Alterations and Modifications: If alterations are required the flowchart may require re-drawing completely. This will usually waste valuable time. 3.Reproduction: As the flowchart symbols cannot be typed, reproduction of flowchart becomes a problem.
  • 14. Thank you 8/2/2017Ms SURBHI SAROHA(Asst.Professor)14