SlideShare a Scribd company logo
1 of 8
Download to read offline
Algorithm &
Pseudo Code
Syed Zaid Irshad
Outline
– Algorithm
– What is an algorithm?
– How are mathematical statements and algorithms related?
– What do algorithms have to do with computers?
– Pseudo Code
– What is pseudocode?
– Writing pseudocode
– Pseudo Code vs Algorithm
What is an algorithm?
– An algorithm is a finite, explicit step-by-step procedure for solving a specific problem or
accomplishing a specific goal.
– We frequently talk about algorithms in mathematical terms, and many algorithms are
expressed using notation borrowed from mathematics, but algorithms aren't necessarily
mathematical in the operations performed, or in the results produced.
– In general, an effective algorithm has these characteristics:
– Explicit, complete, and precise initial conditions;
– A finite, complete, unbroken
– Explicit, complete, and precise terminal (stopping) conditions
How are mathematical statements
and algorithms related?
5(𝐹 − 32) = 9𝐶
– First, convert expression into a form that expresses C as a function of F:
C=5/9 * (F – 32)
– Now it's a straightforward task to write an algorithm (based on the standard order
of arithmetic operations) to convert from Fahrenheit to Celsius.
– Start with a given temperature in degrees Fahrenheit.
– Subtract 32 from the value used in step # 1.
– Multiply the result of step # 2 by 5.
– Divide the result of step # 3 by 9.
– The result of step # 4 is the temperature in degrees Celsius.
What do algorithms have to do
with computers?
– Computer programming consists, in large part, of creating unambiguous, step-by-step
procedures for the computer to follow, to produce specific results. In other words, we might
say that computer programming is almost all about algorithms.
– In many respects, computers are electronic idiot savants: they can perform amazing feats of
calculation and memory, but without our help, they're almost totally incompetent when it
comes to applying those abilities to practical problems.
– Want to compute the sine of an angle? How about computing the natural logarithm of a
number? These tasks are easy for a computer –, in most modern computers, these operations
are built into the CPU itself.
– But if you want to plot the graph of y=sin x on the screen, or balance your cheque book, or
compute the area of the region 1≤x≤100,0≤y≤1/x, the computer is helpless – until someone
writes algorithms to accomplish these tasks, and “teaches” them to the computer.
What is pseudocode?
– Simply put, it's a set of practices and conventions for producing very precise, minimally
ambiguous descriptions of algorithms.
– One way this can be accomplished is through the use of algebraic conventions for variable
naming and expressions, as well as specialized notation from set theory, linear algebra, and
other branches of mathematics.
– The use of these mathematical conventions can go a long way toward reducing ambiguity in
the description of an algorithm.
– Ultimately, the most important characteristic of pseudocode is not really what it is, but what it
enables.
– Working from well-written pseudocode, virtually any programmer with professional
competence in a given programming language should be able to implement the algorithm
described by the pseudocode, in the given language, with little or no need for further
instruction.
Writing pseudocode
C=5/9 * (F – 32)
FahrenheitToCelsius()
Begin
Read: F;
Set C = 5/9 * (F – 32);
Print C;
End
Pseudo Code vs Algorithm

More Related Content

What's hot

4 coding from algorithms
4 coding from algorithms4 coding from algorithms
4 coding from algorithms
hccit
 
flowchart & algorithms
flowchart & algorithmsflowchart & algorithms
flowchart & algorithms
Student
 

What's hot (20)

4 coding from algorithms
4 coding from algorithms4 coding from algorithms
4 coding from algorithms
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
 
Algorithm & flow chart
Algorithm & flow chartAlgorithm & flow chart
Algorithm & flow chart
 
Unit 1. Problem Solving with Computer
Unit 1. Problem Solving with Computer   Unit 1. Problem Solving with Computer
Unit 1. Problem Solving with Computer
 
Algorithm defination, design & Implementation
Algorithm defination, design & ImplementationAlgorithm defination, design & Implementation
Algorithm defination, design & Implementation
 
Flowcharts and algorithms
Flowcharts and algorithmsFlowcharts and algorithms
Flowcharts and algorithms
 
Programming Paradigm & Languages
Programming Paradigm & LanguagesProgramming Paradigm & Languages
Programming Paradigm & Languages
 
flowchart & algorithms
flowchart & algorithmsflowchart & algorithms
flowchart & algorithms
 
Procedural programming
Procedural programmingProcedural programming
Procedural programming
 
Introduction to Procedural Programming in C++
Introduction to Procedural Programming in C++Introduction to Procedural Programming in C++
Introduction to Procedural Programming in C++
 
Algorithms
AlgorithmsAlgorithms
Algorithms
 
Pseudo code
Pseudo codePseudo code
Pseudo code
 
Algorithm and flowchart
Algorithm and flowchartAlgorithm and flowchart
Algorithm and flowchart
 
Algorithm and Programming (Introduction of Algorithms)
Algorithm and Programming (Introduction of Algorithms)Algorithm and Programming (Introduction of Algorithms)
Algorithm and Programming (Introduction of Algorithms)
 
phases of algorithm
phases of algorithmphases of algorithm
phases of algorithm
 
Introduction to Algorithms & flow charts
Introduction to Algorithms & flow chartsIntroduction to Algorithms & flow charts
Introduction to Algorithms & flow charts
 
Algorithms and flowcharts
Algorithms and flowchartsAlgorithms and flowcharts
Algorithms and flowcharts
 
Algorithm & flowchart
Algorithm & flowchartAlgorithm & flowchart
Algorithm & flowchart
 
3 algorithm-and-flowchart
3 algorithm-and-flowchart3 algorithm-and-flowchart
3 algorithm-and-flowchart
 
Graphical Programming is Dead
Graphical Programming is DeadGraphical Programming is Dead
Graphical Programming is Dead
 

Similar to Algorithm Pseudo

PPT slides - MACHINE PERCEPTION LABORATORY
PPT slides - MACHINE PERCEPTION LABORATORYPPT slides - MACHINE PERCEPTION LABORATORY
PPT slides - MACHINE PERCEPTION LABORATORY
butest
 

Similar to Algorithm Pseudo (20)

Algorithm n problem solving x
Algorithm n problem solving xAlgorithm n problem solving x
Algorithm n problem solving x
 
PPT slides - MACHINE PERCEPTION LABORATORY
PPT slides - MACHINE PERCEPTION LABORATORYPPT slides - MACHINE PERCEPTION LABORATORY
PPT slides - MACHINE PERCEPTION LABORATORY
 
D. Vulcanov: Symbolic Computation Methods in Cosmology and General Relativity...
D. Vulcanov: Symbolic Computation Methods in Cosmology and General Relativity...D. Vulcanov: Symbolic Computation Methods in Cosmology and General Relativity...
D. Vulcanov: Symbolic Computation Methods in Cosmology and General Relativity...
 
CS8461 - Design and Analysis of Algorithms
CS8461 - Design and Analysis of AlgorithmsCS8461 - Design and Analysis of Algorithms
CS8461 - Design and Analysis of Algorithms
 
Daa chapter 1
Daa chapter 1Daa chapter 1
Daa chapter 1
 
chapter 1
chapter 1chapter 1
chapter 1
 
Notion of an algorithm
Notion of an algorithmNotion of an algorithm
Notion of an algorithm
 
ProgFund_Lecture7_Programming_Algorithm.pdf
ProgFund_Lecture7_Programming_Algorithm.pdfProgFund_Lecture7_Programming_Algorithm.pdf
ProgFund_Lecture7_Programming_Algorithm.pdf
 
Uses Of Calculus is Computer Science
Uses Of Calculus is Computer ScienceUses Of Calculus is Computer Science
Uses Of Calculus is Computer Science
 
Csci101 lect00 introduction
Csci101 lect00 introductionCsci101 lect00 introduction
Csci101 lect00 introduction
 
19IS402_LP1_LM_22-23.pdf
19IS402_LP1_LM_22-23.pdf19IS402_LP1_LM_22-23.pdf
19IS402_LP1_LM_22-23.pdf
 
INTRODUCTION TO INFORMATION TECHNOLOGY -SARASWATHI RAMALINGAM
INTRODUCTION TO INFORMATION TECHNOLOGY -SARASWATHI RAMALINGAMINTRODUCTION TO INFORMATION TECHNOLOGY -SARASWATHI RAMALINGAM
INTRODUCTION TO INFORMATION TECHNOLOGY -SARASWATHI RAMALINGAM
 
ALGO.ppt
ALGO.pptALGO.ppt
ALGO.ppt
 
CP4151 ADSA unit1 Advanced Data Structures and Algorithms
CP4151 ADSA unit1 Advanced Data Structures and AlgorithmsCP4151 ADSA unit1 Advanced Data Structures and Algorithms
CP4151 ADSA unit1 Advanced Data Structures and Algorithms
 
Algorithm itabq
Algorithm itabqAlgorithm itabq
Algorithm itabq
 
complexity analysis.pdf
complexity analysis.pdfcomplexity analysis.pdf
complexity analysis.pdf
 
How to Design an Algorithm
How to Design an AlgorithmHow to Design an Algorithm
How to Design an Algorithm
 
Vision Algorithmics
Vision AlgorithmicsVision Algorithmics
Vision Algorithmics
 
Tutorial
TutorialTutorial
Tutorial
 
Lec 2 -algorithms-flowchart-and-pseudocode1.pptx
Lec 2 -algorithms-flowchart-and-pseudocode1.pptxLec 2 -algorithms-flowchart-and-pseudocode1.pptx
Lec 2 -algorithms-flowchart-and-pseudocode1.pptx
 

More from Syed Zaid Irshad

Basic Concept of Information Technology
Basic Concept of Information TechnologyBasic Concept of Information Technology
Basic Concept of Information Technology
Syed Zaid Irshad
 
Introduction to ICS 1st Year Book
Introduction to ICS 1st Year BookIntroduction to ICS 1st Year Book
Introduction to ICS 1st Year Book
Syed Zaid Irshad
 
Using single row functions to customize output
Using single row functions to customize outputUsing single row functions to customize output
Using single row functions to customize output
Syed Zaid Irshad
 

More from Syed Zaid Irshad (20)

Operating System.pdf
Operating System.pdfOperating System.pdf
Operating System.pdf
 
DBMS_Lab_Manual_&_Solution
DBMS_Lab_Manual_&_SolutionDBMS_Lab_Manual_&_Solution
DBMS_Lab_Manual_&_Solution
 
Data Structure and Algorithms.pptx
Data Structure and Algorithms.pptxData Structure and Algorithms.pptx
Data Structure and Algorithms.pptx
 
Design and Analysis of Algorithms.pptx
Design and Analysis of Algorithms.pptxDesign and Analysis of Algorithms.pptx
Design and Analysis of Algorithms.pptx
 
Professional Issues in Computing
Professional Issues in ComputingProfessional Issues in Computing
Professional Issues in Computing
 
Reduce course notes class xi
Reduce course notes class xiReduce course notes class xi
Reduce course notes class xi
 
Reduce course notes class xii
Reduce course notes class xiiReduce course notes class xii
Reduce course notes class xii
 
Introduction to Database
Introduction to DatabaseIntroduction to Database
Introduction to Database
 
Flowchart
FlowchartFlowchart
Flowchart
 
Computer Programming
Computer ProgrammingComputer Programming
Computer Programming
 
ICS 2nd Year Book Introduction
ICS 2nd Year Book IntroductionICS 2nd Year Book Introduction
ICS 2nd Year Book Introduction
 
Security, Copyright and the Law
Security, Copyright and the LawSecurity, Copyright and the Law
Security, Copyright and the Law
 
Computer Architecture
Computer ArchitectureComputer Architecture
Computer Architecture
 
Data Communication
Data CommunicationData Communication
Data Communication
 
Information Networks
Information NetworksInformation Networks
Information Networks
 
Basic Concept of Information Technology
Basic Concept of Information TechnologyBasic Concept of Information Technology
Basic Concept of Information Technology
 
Introduction to ICS 1st Year Book
Introduction to ICS 1st Year BookIntroduction to ICS 1st Year Book
Introduction to ICS 1st Year Book
 
Using the set operators
Using the set operatorsUsing the set operators
Using the set operators
 
Using subqueries to solve queries
Using subqueries to solve queriesUsing subqueries to solve queries
Using subqueries to solve queries
 
Using single row functions to customize output
Using single row functions to customize outputUsing single row functions to customize output
Using single row functions to customize output
 

Recently uploaded

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
SoniaTolstoy
 

Recently uploaded (20)

APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.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
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 

Algorithm Pseudo

  • 2. Outline – Algorithm – What is an algorithm? – How are mathematical statements and algorithms related? – What do algorithms have to do with computers? – Pseudo Code – What is pseudocode? – Writing pseudocode – Pseudo Code vs Algorithm
  • 3. What is an algorithm? – An algorithm is a finite, explicit step-by-step procedure for solving a specific problem or accomplishing a specific goal. – We frequently talk about algorithms in mathematical terms, and many algorithms are expressed using notation borrowed from mathematics, but algorithms aren't necessarily mathematical in the operations performed, or in the results produced. – In general, an effective algorithm has these characteristics: – Explicit, complete, and precise initial conditions; – A finite, complete, unbroken – Explicit, complete, and precise terminal (stopping) conditions
  • 4. How are mathematical statements and algorithms related? 5(𝐹 − 32) = 9𝐶 – First, convert expression into a form that expresses C as a function of F: C=5/9 * (F – 32) – Now it's a straightforward task to write an algorithm (based on the standard order of arithmetic operations) to convert from Fahrenheit to Celsius. – Start with a given temperature in degrees Fahrenheit. – Subtract 32 from the value used in step # 1. – Multiply the result of step # 2 by 5. – Divide the result of step # 3 by 9. – The result of step # 4 is the temperature in degrees Celsius.
  • 5. What do algorithms have to do with computers? – Computer programming consists, in large part, of creating unambiguous, step-by-step procedures for the computer to follow, to produce specific results. In other words, we might say that computer programming is almost all about algorithms. – In many respects, computers are electronic idiot savants: they can perform amazing feats of calculation and memory, but without our help, they're almost totally incompetent when it comes to applying those abilities to practical problems. – Want to compute the sine of an angle? How about computing the natural logarithm of a number? These tasks are easy for a computer –, in most modern computers, these operations are built into the CPU itself. – But if you want to plot the graph of y=sin x on the screen, or balance your cheque book, or compute the area of the region 1≤x≤100,0≤y≤1/x, the computer is helpless – until someone writes algorithms to accomplish these tasks, and “teaches” them to the computer.
  • 6. What is pseudocode? – Simply put, it's a set of practices and conventions for producing very precise, minimally ambiguous descriptions of algorithms. – One way this can be accomplished is through the use of algebraic conventions for variable naming and expressions, as well as specialized notation from set theory, linear algebra, and other branches of mathematics. – The use of these mathematical conventions can go a long way toward reducing ambiguity in the description of an algorithm. – Ultimately, the most important characteristic of pseudocode is not really what it is, but what it enables. – Working from well-written pseudocode, virtually any programmer with professional competence in a given programming language should be able to implement the algorithm described by the pseudocode, in the given language, with little or no need for further instruction.
  • 7. Writing pseudocode C=5/9 * (F – 32) FahrenheitToCelsius() Begin Read: F; Set C = 5/9 * (F – 32); Print C; End
  • 8. Pseudo Code vs Algorithm