SlideShare a Scribd company logo
Pseudo code
ag1805x
Pseudo code
• An informal high-level description of the operating principle of
a computer program or other algorithm.
• It uses the structural conventions of a programming language,
but is intended for human reading rather than machine
reading.
• Pseudo code typically omits details that are essential for
machine understanding of the algorithm, such as variable
declarations, system-specific code and some subroutines.
• The programming language is augmented with natural
language description details, where convenient, or with
compact mathematical notation.
Purpose
• The purpose of using pseudo code is that it is easier for people
to understand than conventional programming language code,
and that it is an efficient and environment independent
description of the key principles of an algorithm.
Applications
• Textbooks and scientific publications related to computer
science and numerical computation often use pseudo code in
description of algorithms, so that all programmers can
understand them, even if they do not all know the same
programming languages. In textbooks, there is usually an
accompanying introduction explaining the particular
conventions in use. The level of detail of the pseudo-code may
in some cases approach that of formalized general purpose
languages.
Applications [contd.]
• A programmer who needs to implement a specific algorithm,
especially an unfamiliar one, will often start with a pseudo
code description, and then “translate” that description into
the target programming language and modify it to interact
correctly with the rest of the program. Programmers may also
start a project by sketching out the code in pseudo code on
paper before writing it in its actual language, as a top-down
structuring approach, with a process of steps to be followed as
a refinement.
Syntax
• Pseudo code generally does not actually obey the syntax rules
of any particular language.
• There is no systematic standard form.
• Any particular writer will generally borrow style and syntax for
example, control structures from some conventional
programming language.
• Popular syntax sources include Fortran, Pascal, BASIC, C, C++,
Java, Lisp, and ALGOL.
• Variable declarations are typically omitted.
• Function calls and blocks of code, such as code contained
within a loop, are often replaced by a one-line natural
language sentence.
Pseudo code for sorting
• Sorting: To arrange set of elements into proper order
(ascending/descending).
• To sort an array there are 3 basic algorithms:
• Bubble Sort
• Selection Sort
• Insertion Sort
• Bubble Sort: Suppose A is an array of N values. We want to
sort A in ascending order. Bubble Sort is a simple minded
algorithm based on the idea that we look at the list, and
wherever we find two consecutive elements out of order, we
swap them. We do this as follows: We repeatedly traverse the
unsorted part of the array, comparing consecutive elements,
and we interchange them when they are out of order.
• Pseudocode:
• Selection Sort: Suppose A is an array of N values. We want to
sort A in ascending order. That is, A[1] should be the smallest
and A[N] should be the largest. The idea of Selection Sort is
that we repeatedly find the smallest element in the unsorted
part of the array and swap it with the first element in the
unsorted part of the array.
• Pseudo code:
• Insertion Sort: Suppose A is an array of N values. We want to
sort A in ascending order. Insertion Sort is an algorithm to do
this as follows: We traverse the array and insert each element
into the sorted part of the list where it belongs. This usually
involves pushing down the larger elements in the sorted part.
• Pseudo code:
Pseudo code for finding maximum
• Suppose A is an array of N values. We want to find the
maximum. We set the first value of the array as the maximum
and then traverse through the array and check if there are
values more than the maximum value. If present we change
the value of maximum and continue through the array.
• Pseudo code:
Pseudo code for finding minimum
• Suppose A is an array of N values. We want to find the
minimum. We set the first value of the array as the minimum
and then traverse through the array and check if there are
values less than the minimum value. If present we change the
value of minimum and continue through the array.
• Pseudo code:
Pseudo code

More Related Content

What's hot

instruction cycle ppt
instruction cycle pptinstruction cycle ppt
instruction cycle pptsheetal singh
 
Pseudocode
PseudocodePseudocode
Pseudocode
grahamwell
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
Ashhad Kamal
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
Ratnakar Mikkili
 
Chapter 14 - Protection
Chapter 14 - ProtectionChapter 14 - Protection
Chapter 14 - Protection
Wayne Jones Jnr
 
Language processor
Language processorLanguage processor
Language processorAbha Damani
 
Lecture 01 introduction to compiler
Lecture 01 introduction to compilerLecture 01 introduction to compiler
Lecture 01 introduction to compiler
Iffat Anjum
 
Loops in C Programming Language
Loops in C Programming LanguageLoops in C Programming Language
Loops in C Programming Language
Mahantesh Devoor
 
Constants in C Programming
Constants in C ProgrammingConstants in C Programming
Constants in C Programming
programming9
 
GE8151 Problem Solving and Python Programming
GE8151 Problem Solving and Python ProgrammingGE8151 Problem Solving and Python Programming
GE8151 Problem Solving and Python Programming
Muthu Vinayagam
 
Unit 1-problem solving with algorithm
Unit 1-problem solving with algorithmUnit 1-problem solving with algorithm
Unit 1-problem solving with algorithm
rajkumar1631010038
 
Pointers in c language
Pointers in c languagePointers in c language
Pointers in c language
Tanmay Modi
 
Loops c++
Loops c++Loops c++
Loops c++
Shivani Singh
 
Unit 1. Problem Solving with Computer
Unit 1. Problem Solving with Computer   Unit 1. Problem Solving with Computer
Unit 1. Problem Solving with Computer
Ashim Lamichhane
 
Algorithm
AlgorithmAlgorithm
Algorithm
IHTISHAM UL HAQ
 
Basic programming concepts
Basic programming conceptsBasic programming concepts
Basic programming conceptssalmankhan570
 
Interrupts
InterruptsInterrupts
Interrupts
Urwa Shanza
 
Algorithm and Flowcharts
Algorithm and FlowchartsAlgorithm and Flowcharts
Algorithm and Flowcharts
SURBHI SAROHA
 
Code optimization in compiler design
Code optimization in compiler designCode optimization in compiler design
Code optimization in compiler design
Kuppusamy P
 

What's hot (20)

instruction cycle ppt
instruction cycle pptinstruction cycle ppt
instruction cycle ppt
 
Pseudocode
PseudocodePseudocode
Pseudocode
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
Chapter 14 - Protection
Chapter 14 - ProtectionChapter 14 - Protection
Chapter 14 - Protection
 
Language processor
Language processorLanguage processor
Language processor
 
Lecture 01 introduction to compiler
Lecture 01 introduction to compilerLecture 01 introduction to compiler
Lecture 01 introduction to compiler
 
Loops in C Programming Language
Loops in C Programming LanguageLoops in C Programming Language
Loops in C Programming Language
 
Constants in C Programming
Constants in C ProgrammingConstants in C Programming
Constants in C Programming
 
Function in c
Function in cFunction in c
Function in c
 
GE8151 Problem Solving and Python Programming
GE8151 Problem Solving and Python ProgrammingGE8151 Problem Solving and Python Programming
GE8151 Problem Solving and Python Programming
 
Unit 1-problem solving with algorithm
Unit 1-problem solving with algorithmUnit 1-problem solving with algorithm
Unit 1-problem solving with algorithm
 
Pointers in c language
Pointers in c languagePointers in c language
Pointers in c language
 
Loops c++
Loops c++Loops c++
Loops c++
 
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
AlgorithmAlgorithm
Algorithm
 
Basic programming concepts
Basic programming conceptsBasic programming concepts
Basic programming concepts
 
Interrupts
InterruptsInterrupts
Interrupts
 
Algorithm and Flowcharts
Algorithm and FlowchartsAlgorithm and Flowcharts
Algorithm and Flowcharts
 
Code optimization in compiler design
Code optimization in compiler designCode optimization in compiler design
Code optimization in compiler design
 

Viewers also liked

C++ in sinhala
C++ in sinhalaC++ in sinhala
C++ in sinhala
Uditha Kekulawala
 
Algorithm and pseudo codes
Algorithm and pseudo codesAlgorithm and pseudo codes
Algorithm and pseudo codeshermiraguilar
 
Introduction to Pseudocode
Introduction to PseudocodeIntroduction to Pseudocode
Introduction to PseudocodeDamian T. Gordon
 
Dictionary based-secure-provenance Comparissoion for wireless sensor nertwork
Dictionary based-secure-provenance Comparissoion for wireless sensor nertworkDictionary based-secure-provenance Comparissoion for wireless sensor nertwork
Dictionary based-secure-provenance Comparissoion for wireless sensor nertwork
Shakas Technologies
 
Flow chart and pseudo code
Flow chart and pseudo code Flow chart and pseudo code
Flow chart and pseudo code
Niva tharan
 
Pseudocode
PseudocodePseudocode
Pseudocode
Harsha Madushanka
 
Pseudocode basics
Pseudocode basicsPseudocode basics
Pseudocode basicskiran_kaur
 
Cmp104 lec 7 algorithm and flowcharts
Cmp104 lec 7 algorithm and flowchartsCmp104 lec 7 algorithm and flowcharts
Cmp104 lec 7 algorithm and flowchartskapil078
 
pseudo code basics
pseudo code basicspseudo code basics
pseudo code basics
Sabik T S
 
Pseudo code
Pseudo codePseudo code
Pseudo code
abukky52
 
Pseudocode flowcharts
Pseudocode flowchartsPseudocode flowcharts
Pseudocode flowchartsnicky_walters
 

Viewers also liked (12)

C++ in sinhala
C++ in sinhalaC++ in sinhala
C++ in sinhala
 
Algorithm and pseudo codes
Algorithm and pseudo codesAlgorithm and pseudo codes
Algorithm and pseudo codes
 
Introduction to Pseudocode
Introduction to PseudocodeIntroduction to Pseudocode
Introduction to Pseudocode
 
Dictionary based-secure-provenance Comparissoion for wireless sensor nertwork
Dictionary based-secure-provenance Comparissoion for wireless sensor nertworkDictionary based-secure-provenance Comparissoion for wireless sensor nertwork
Dictionary based-secure-provenance Comparissoion for wireless sensor nertwork
 
pseudo code
pseudo codepseudo code
pseudo code
 
Flow chart and pseudo code
Flow chart and pseudo code Flow chart and pseudo code
Flow chart and pseudo code
 
Pseudocode
PseudocodePseudocode
Pseudocode
 
Pseudocode basics
Pseudocode basicsPseudocode basics
Pseudocode basics
 
Cmp104 lec 7 algorithm and flowcharts
Cmp104 lec 7 algorithm and flowchartsCmp104 lec 7 algorithm and flowcharts
Cmp104 lec 7 algorithm and flowcharts
 
pseudo code basics
pseudo code basicspseudo code basics
pseudo code basics
 
Pseudo code
Pseudo codePseudo code
Pseudo code
 
Pseudocode flowcharts
Pseudocode flowchartsPseudocode flowcharts
Pseudocode flowcharts
 

Similar to Pseudo code

Algorithms and problem solving.pptx
Algorithms and problem solving.pptxAlgorithms and problem solving.pptx
Algorithms and problem solving.pptx
aikomo1
 
Engineering CS 5th Sem Python Module -2.pptx
Engineering CS 5th Sem Python Module -2.pptxEngineering CS 5th Sem Python Module -2.pptx
Engineering CS 5th Sem Python Module -2.pptx
hardii0991
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
Paolo Carrasco Mori
 
Lecture 12 Bottom-UP Parsing.pptx
Lecture 12 Bottom-UP Parsing.pptxLecture 12 Bottom-UP Parsing.pptx
Lecture 12 Bottom-UP Parsing.pptx
Yusra11491
 
Algorithm and pseudocode conventions
Algorithm and pseudocode conventionsAlgorithm and pseudocode conventions
Algorithm and pseudocode conventions
saranyatdr
 
web programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh Malothweb programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh Maloth
Bhavsingh Maloth
 
DAA Unit 1.pdf
DAA Unit 1.pdfDAA Unit 1.pdf
DAA Unit 1.pdf
Nirmalavenkatachalam
 
Python: The Iterator Pattern (Comprehensions)
Python: The Iterator Pattern (Comprehensions)Python: The Iterator Pattern (Comprehensions)
Python: The Iterator Pattern (Comprehensions)
Damian T. Gordon
 
Data structure Unit-I Part A
Data structure Unit-I Part AData structure Unit-I Part A
Data structure Unit-I Part A
SSN College of Engineering, Kalavakkam
 
Programming Basics.pptx
Programming Basics.pptxProgramming Basics.pptx
Programming Basics.pptx
mahendranaik18
 
Symbol Table, Error Handler & Code Generation
Symbol Table, Error Handler & Code GenerationSymbol Table, Error Handler & Code Generation
Symbol Table, Error Handler & Code Generation
Akhil Kaushik
 
Algorithms & Complexity Calculation
Algorithms & Complexity CalculationAlgorithms & Complexity Calculation
Algorithms & Complexity Calculation
Akhil Kaushik
 
chapter 5.ppt
chapter 5.pptchapter 5.ppt
chapter 5.ppt
ThedronBerhanu
 
General Programming Concept
General Programming ConceptGeneral Programming Concept
General Programming Concept
Haris Bin Zahid
 
RAJAT PROJECT.pptx
RAJAT PROJECT.pptxRAJAT PROJECT.pptx
RAJAT PROJECT.pptx
SayedMohdAsim2
 
02 Algorithms and flowcharts - computers.pptx
02 Algorithms and flowcharts - computers.pptx02 Algorithms and flowcharts - computers.pptx
02 Algorithms and flowcharts - computers.pptx
arifaqazi2
 
Lec01-Algorithems - Introduction and Overview.pdf
Lec01-Algorithems - Introduction and Overview.pdfLec01-Algorithems - Introduction and Overview.pdf
Lec01-Algorithems - Introduction and Overview.pdf
MAJDABDALLAH3
 
Data Structure and Algorithms –Introduction.pptx
Data Structure and Algorithms –Introduction.pptxData Structure and Algorithms –Introduction.pptx
Data Structure and Algorithms –Introduction.pptx
R S Anu Prabha
 

Similar to Pseudo code (20)

Python Tutorial Part 1
Python Tutorial Part 1Python Tutorial Part 1
Python Tutorial Part 1
 
Algorithms and problem solving.pptx
Algorithms and problem solving.pptxAlgorithms and problem solving.pptx
Algorithms and problem solving.pptx
 
Engineering CS 5th Sem Python Module -2.pptx
Engineering CS 5th Sem Python Module -2.pptxEngineering CS 5th Sem Python Module -2.pptx
Engineering CS 5th Sem Python Module -2.pptx
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
Lecture 12 Bottom-UP Parsing.pptx
Lecture 12 Bottom-UP Parsing.pptxLecture 12 Bottom-UP Parsing.pptx
Lecture 12 Bottom-UP Parsing.pptx
 
Algorithm and pseudocode conventions
Algorithm and pseudocode conventionsAlgorithm and pseudocode conventions
Algorithm and pseudocode conventions
 
web programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh Malothweb programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh Maloth
 
DAA Unit 1.pdf
DAA Unit 1.pdfDAA Unit 1.pdf
DAA Unit 1.pdf
 
Python: The Iterator Pattern (Comprehensions)
Python: The Iterator Pattern (Comprehensions)Python: The Iterator Pattern (Comprehensions)
Python: The Iterator Pattern (Comprehensions)
 
Data structure Unit-I Part A
Data structure Unit-I Part AData structure Unit-I Part A
Data structure Unit-I Part A
 
Programming Basics.pptx
Programming Basics.pptxProgramming Basics.pptx
Programming Basics.pptx
 
Symbol Table, Error Handler & Code Generation
Symbol Table, Error Handler & Code GenerationSymbol Table, Error Handler & Code Generation
Symbol Table, Error Handler & Code Generation
 
Algorithms & Complexity Calculation
Algorithms & Complexity CalculationAlgorithms & Complexity Calculation
Algorithms & Complexity Calculation
 
chapter 5.ppt
chapter 5.pptchapter 5.ppt
chapter 5.ppt
 
General Programming Concept
General Programming ConceptGeneral Programming Concept
General Programming Concept
 
RAJAT PROJECT.pptx
RAJAT PROJECT.pptxRAJAT PROJECT.pptx
RAJAT PROJECT.pptx
 
02 Algorithms and flowcharts - computers.pptx
02 Algorithms and flowcharts - computers.pptx02 Algorithms and flowcharts - computers.pptx
02 Algorithms and flowcharts - computers.pptx
 
Lec01-Algorithems - Introduction and Overview.pdf
Lec01-Algorithems - Introduction and Overview.pdfLec01-Algorithems - Introduction and Overview.pdf
Lec01-Algorithems - Introduction and Overview.pdf
 
Data Structure and Algorithms –Introduction.pptx
Data Structure and Algorithms –Introduction.pptxData Structure and Algorithms –Introduction.pptx
Data Structure and Algorithms –Introduction.pptx
 
Python Module-1.1.pdf
Python Module-1.1.pdfPython Module-1.1.pdf
Python Module-1.1.pdf
 

More from Arindam Ghosh

Network embedding in biomedical data science
Network embedding in biomedical data scienceNetwork embedding in biomedical data science
Network embedding in biomedical data science
Arindam Ghosh
 
Next Generation Sequencing
Next Generation SequencingNext Generation Sequencing
Next Generation Sequencing
Arindam Ghosh
 
Sequence alignment
Sequence alignmentSequence alignment
Sequence alignment
Arindam Ghosh
 
Pharmacogenomics & its ethical issues
Pharmacogenomics & its ethical  issuesPharmacogenomics & its ethical  issues
Pharmacogenomics & its ethical issues
Arindam Ghosh
 
Limb development in vertebrates
Limb development in vertebratesLimb development in vertebrates
Limb development in vertebrates
Arindam Ghosh
 
Canning fish
Canning fishCanning fish
Canning fish
Arindam Ghosh
 
Polymerase Chain Reaction (PCR)
Polymerase Chain Reaction (PCR)Polymerase Chain Reaction (PCR)
Polymerase Chain Reaction (PCR)
Arindam Ghosh
 
Carbon Nanotubes
Carbon NanotubesCarbon Nanotubes
Carbon Nanotubes
Arindam Ghosh
 
Monte Carlo Simulations & Membrane Simulation and Dynamics
Monte Carlo Simulations & Membrane Simulation and DynamicsMonte Carlo Simulations & Membrane Simulation and Dynamics
Monte Carlo Simulations & Membrane Simulation and Dynamics
Arindam Ghosh
 
Java - Interfaces & Packages
Java - Interfaces & PackagesJava - Interfaces & Packages
Java - Interfaces & Packages
Arindam Ghosh
 
Freshers day anchoring script
Freshers day anchoring scriptFreshers day anchoring script
Freshers day anchoring script
Arindam Ghosh
 
Ab Initio Protein Structure Prediction
Ab Initio Protein Structure PredictionAb Initio Protein Structure Prediction
Ab Initio Protein Structure Prediction
Arindam Ghosh
 
Artificial Vectors
Artificial VectorsArtificial Vectors
Artificial Vectors
Arindam Ghosh
 
Hamiltonian path
Hamiltonian pathHamiltonian path
Hamiltonian path
Arindam Ghosh
 
Cedrus of Himachal Pradesh
Cedrus of Himachal PradeshCedrus of Himachal Pradesh
Cedrus of Himachal Pradesh
Arindam Ghosh
 
MySQL and bioinformatics
MySQL and bioinformatics MySQL and bioinformatics
MySQL and bioinformatics
Arindam Ghosh
 
Protein sorting in mitochondria
Protein sorting in mitochondriaProtein sorting in mitochondria
Protein sorting in mitochondria
Arindam Ghosh
 
Survey of softwares for phylogenetic analysis
Survey of softwares for phylogenetic analysisSurvey of softwares for phylogenetic analysis
Survey of softwares for phylogenetic analysis
Arindam Ghosh
 
Publicly available tools and open resources in Bioinformatics
Publicly available  tools and open resources in BioinformaticsPublicly available  tools and open resources in Bioinformatics
Publicly available tools and open resources in Bioinformatics
Arindam Ghosh
 

More from Arindam Ghosh (19)

Network embedding in biomedical data science
Network embedding in biomedical data scienceNetwork embedding in biomedical data science
Network embedding in biomedical data science
 
Next Generation Sequencing
Next Generation SequencingNext Generation Sequencing
Next Generation Sequencing
 
Sequence alignment
Sequence alignmentSequence alignment
Sequence alignment
 
Pharmacogenomics & its ethical issues
Pharmacogenomics & its ethical  issuesPharmacogenomics & its ethical  issues
Pharmacogenomics & its ethical issues
 
Limb development in vertebrates
Limb development in vertebratesLimb development in vertebrates
Limb development in vertebrates
 
Canning fish
Canning fishCanning fish
Canning fish
 
Polymerase Chain Reaction (PCR)
Polymerase Chain Reaction (PCR)Polymerase Chain Reaction (PCR)
Polymerase Chain Reaction (PCR)
 
Carbon Nanotubes
Carbon NanotubesCarbon Nanotubes
Carbon Nanotubes
 
Monte Carlo Simulations & Membrane Simulation and Dynamics
Monte Carlo Simulations & Membrane Simulation and DynamicsMonte Carlo Simulations & Membrane Simulation and Dynamics
Monte Carlo Simulations & Membrane Simulation and Dynamics
 
Java - Interfaces & Packages
Java - Interfaces & PackagesJava - Interfaces & Packages
Java - Interfaces & Packages
 
Freshers day anchoring script
Freshers day anchoring scriptFreshers day anchoring script
Freshers day anchoring script
 
Ab Initio Protein Structure Prediction
Ab Initio Protein Structure PredictionAb Initio Protein Structure Prediction
Ab Initio Protein Structure Prediction
 
Artificial Vectors
Artificial VectorsArtificial Vectors
Artificial Vectors
 
Hamiltonian path
Hamiltonian pathHamiltonian path
Hamiltonian path
 
Cedrus of Himachal Pradesh
Cedrus of Himachal PradeshCedrus of Himachal Pradesh
Cedrus of Himachal Pradesh
 
MySQL and bioinformatics
MySQL and bioinformatics MySQL and bioinformatics
MySQL and bioinformatics
 
Protein sorting in mitochondria
Protein sorting in mitochondriaProtein sorting in mitochondria
Protein sorting in mitochondria
 
Survey of softwares for phylogenetic analysis
Survey of softwares for phylogenetic analysisSurvey of softwares for phylogenetic analysis
Survey of softwares for phylogenetic analysis
 
Publicly available tools and open resources in Bioinformatics
Publicly available  tools and open resources in BioinformaticsPublicly available  tools and open resources in Bioinformatics
Publicly available tools and open resources in Bioinformatics
 

Recently uploaded

South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
Reflective and Evaluative Practice...pdf
Reflective and Evaluative Practice...pdfReflective and Evaluative Practice...pdf
Reflective and Evaluative Practice...pdf
amberjdewit93
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
RitikBhardwaj56
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
Reflective and Evaluative Practice PowerPoint
Reflective and Evaluative Practice PowerPointReflective and Evaluative Practice PowerPoint
Reflective and Evaluative Practice PowerPoint
amberjdewit93
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
Celine George
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
goswamiyash170123
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 

Recently uploaded (20)

South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
Reflective and Evaluative Practice...pdf
Reflective and Evaluative Practice...pdfReflective and Evaluative Practice...pdf
Reflective and Evaluative Practice...pdf
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
Reflective and Evaluative Practice PowerPoint
Reflective and Evaluative Practice PowerPointReflective and Evaluative Practice PowerPoint
Reflective and Evaluative Practice PowerPoint
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 

Pseudo code

  • 2. Pseudo code • An informal high-level description of the operating principle of a computer program or other algorithm. • It uses the structural conventions of a programming language, but is intended for human reading rather than machine reading. • Pseudo code typically omits details that are essential for machine understanding of the algorithm, such as variable declarations, system-specific code and some subroutines. • The programming language is augmented with natural language description details, where convenient, or with compact mathematical notation.
  • 3. Purpose • The purpose of using pseudo code is that it is easier for people to understand than conventional programming language code, and that it is an efficient and environment independent description of the key principles of an algorithm.
  • 4. Applications • Textbooks and scientific publications related to computer science and numerical computation often use pseudo code in description of algorithms, so that all programmers can understand them, even if they do not all know the same programming languages. In textbooks, there is usually an accompanying introduction explaining the particular conventions in use. The level of detail of the pseudo-code may in some cases approach that of formalized general purpose languages.
  • 5. Applications [contd.] • A programmer who needs to implement a specific algorithm, especially an unfamiliar one, will often start with a pseudo code description, and then “translate” that description into the target programming language and modify it to interact correctly with the rest of the program. Programmers may also start a project by sketching out the code in pseudo code on paper before writing it in its actual language, as a top-down structuring approach, with a process of steps to be followed as a refinement.
  • 6. Syntax • Pseudo code generally does not actually obey the syntax rules of any particular language. • There is no systematic standard form. • Any particular writer will generally borrow style and syntax for example, control structures from some conventional programming language. • Popular syntax sources include Fortran, Pascal, BASIC, C, C++, Java, Lisp, and ALGOL. • Variable declarations are typically omitted. • Function calls and blocks of code, such as code contained within a loop, are often replaced by a one-line natural language sentence.
  • 7. Pseudo code for sorting • Sorting: To arrange set of elements into proper order (ascending/descending). • To sort an array there are 3 basic algorithms: • Bubble Sort • Selection Sort • Insertion Sort
  • 8. • Bubble Sort: Suppose A is an array of N values. We want to sort A in ascending order. Bubble Sort is a simple minded algorithm based on the idea that we look at the list, and wherever we find two consecutive elements out of order, we swap them. We do this as follows: We repeatedly traverse the unsorted part of the array, comparing consecutive elements, and we interchange them when they are out of order. • Pseudocode:
  • 9.
  • 10. • Selection Sort: Suppose A is an array of N values. We want to sort A in ascending order. That is, A[1] should be the smallest and A[N] should be the largest. The idea of Selection Sort is that we repeatedly find the smallest element in the unsorted part of the array and swap it with the first element in the unsorted part of the array. • Pseudo code:
  • 11.
  • 12. • Insertion Sort: Suppose A is an array of N values. We want to sort A in ascending order. Insertion Sort is an algorithm to do this as follows: We traverse the array and insert each element into the sorted part of the list where it belongs. This usually involves pushing down the larger elements in the sorted part. • Pseudo code:
  • 13.
  • 14. Pseudo code for finding maximum • Suppose A is an array of N values. We want to find the maximum. We set the first value of the array as the maximum and then traverse through the array and check if there are values more than the maximum value. If present we change the value of maximum and continue through the array. • Pseudo code:
  • 15.
  • 16. Pseudo code for finding minimum • Suppose A is an array of N values. We want to find the minimum. We set the first value of the array as the minimum and then traverse through the array and check if there are values less than the minimum value. If present we change the value of minimum and continue through the array. • Pseudo code: