SlideShare a Scribd company logo
2
Most read
16
Most read
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:
Pseudo code
• 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:
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
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
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

PDF
Introduction to oops concepts
PPTX
Object oriented programming concepts
PPTX
Pseudocode
PPTX
Introduction TO Finite Automata
PPTX
Pseudocode
PPT
Input and output in C++
PPTX
Exception handling in Java
PPTX
Computer system bus
Introduction to oops concepts
Object oriented programming concepts
Pseudocode
Introduction TO Finite Automata
Pseudocode
Input and output in C++
Exception handling in Java
Computer system bus

What's hot (20)

PPT
Basic concept of OOP's
PPT
Exception Handling in JAVA
PPSX
Data Structure (Queue)
PPTX
Introduction to Object Oriented Programming
PPT
Introduction to problem solving in c++
PPTX
Pseudocode flowcharts
PDF
Algorithms Lecture 1: Introduction to Algorithms
PPTX
Direct memory access (dma)
PPTX
Parallel Processing & Pipelining in Computer Architecture_Prof.Sumalatha.pptx
PPTX
Queue in Data Structure
PPTX
Assembly Language
PPT
pseudo code basics
PDF
Introduction to algorithms
PPTX
Object Oriented Programming
DOC
Dbms lab questions
PPT
Coupling and cohesion
PPTX
Priority Queue in Data Structure
PPTX
Looping Statements and Control Statements in Python
PPTX
PPT
Basic concept of OOP's
Exception Handling in JAVA
Data Structure (Queue)
Introduction to Object Oriented Programming
Introduction to problem solving in c++
Pseudocode flowcharts
Algorithms Lecture 1: Introduction to Algorithms
Direct memory access (dma)
Parallel Processing & Pipelining in Computer Architecture_Prof.Sumalatha.pptx
Queue in Data Structure
Assembly Language
pseudo code basics
Introduction to algorithms
Object Oriented Programming
Dbms lab questions
Coupling and cohesion
Priority Queue in Data Structure
Looping Statements and Control Statements in Python
Ad

Viewers also liked (9)

PDF
C++ in sinhala
PPTX
Algorithm and pseudo codes
PPTX
Introduction to Pseudocode
PDF
Dictionary based-secure-provenance Comparissoion for wireless sensor nertwork
PDF
pseudo code
PDF
Flow chart and pseudo code
PPT
Pseudocode basics
PPT
Cmp104 lec 7 algorithm and flowcharts
PDF
Pseudo code
C++ in sinhala
Algorithm and pseudo codes
Introduction to Pseudocode
Dictionary based-secure-provenance Comparissoion for wireless sensor nertwork
pseudo code
Flow chart and pseudo code
Pseudocode basics
Cmp104 lec 7 algorithm and flowcharts
Pseudo code
Ad

Similar to Pseudo code (20)

PPTX
Data Structure and Algorithms –Introduction.pptx
PPTX
Algorithm and pseudocode conventions
PDF
lect 1-ds algo(final)_2.pdf
PPTX
C programming .pptx
PPTX
grade 10 2023.pptx
PPT
Problem Solving Techniques
PPTX
Programming logic &practices
PPTX
Chapter 2.pptx
PPTX
Fundamentals of Programming Lecture #1.pptx
DOC
Algorithm vs
PPT
Program design and problem solving techniques
PPT
Data Structures- Part1 overview and review
PPT
programming language(C++) chapter-one contd.ppt
PPTX
Data structure Unit-I Part A
PDF
Programming 1 [compatibility mode]mm
DOCX
Programming topics. syed arslan rizvi
PPT
Intro to DSAA.ppt
PPT
Chapter 1- C++ programming languages +.ppt
PDF
CP4151 Advanced data structures and algorithms
PPTX
Algorithm Design and Problem Solving [Autosaved].pptx
Data Structure and Algorithms –Introduction.pptx
Algorithm and pseudocode conventions
lect 1-ds algo(final)_2.pdf
C programming .pptx
grade 10 2023.pptx
Problem Solving Techniques
Programming logic &practices
Chapter 2.pptx
Fundamentals of Programming Lecture #1.pptx
Algorithm vs
Program design and problem solving techniques
Data Structures- Part1 overview and review
programming language(C++) chapter-one contd.ppt
Data structure Unit-I Part A
Programming 1 [compatibility mode]mm
Programming topics. syed arslan rizvi
Intro to DSAA.ppt
Chapter 1- C++ programming languages +.ppt
CP4151 Advanced data structures and algorithms
Algorithm Design and Problem Solving [Autosaved].pptx

More from Arindam Ghosh (19)

PPTX
Network embedding in biomedical data science
PDF
Next Generation Sequencing
PPTX
Sequence alignment
PDF
Pharmacogenomics & its ethical issues
PPTX
Limb development in vertebrates
PPTX
Canning fish
PPTX
Polymerase Chain Reaction (PCR)
PDF
Carbon Nanotubes
PDF
Monte Carlo Simulations & Membrane Simulation and Dynamics
PDF
Java - Interfaces & Packages
PDF
Freshers day anchoring script
PDF
Ab Initio Protein Structure Prediction
PDF
Artificial Vectors
PPTX
Hamiltonian path
PPTX
Cedrus of Himachal Pradesh
PDF
MySQL and bioinformatics
PDF
Protein sorting in mitochondria
PDF
Survey of softwares for phylogenetic analysis
PDF
Publicly available tools and open resources in Bioinformatics
Network embedding in biomedical data science
Next Generation Sequencing
Sequence alignment
Pharmacogenomics & its ethical issues
Limb development in vertebrates
Canning fish
Polymerase Chain Reaction (PCR)
Carbon Nanotubes
Monte Carlo Simulations & Membrane Simulation and Dynamics
Java - Interfaces & Packages
Freshers day anchoring script
Ab Initio Protein Structure Prediction
Artificial Vectors
Hamiltonian path
Cedrus of Himachal Pradesh
MySQL and bioinformatics
Protein sorting in mitochondria
Survey of softwares for phylogenetic analysis
Publicly available tools and open resources in Bioinformatics

Recently uploaded (20)

PPTX
Orientation - ARALprogram of Deped to the Parents.pptx
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Complications of Minimal Access Surgery at WLH
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
Cell Types and Its function , kingdom of life
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Microbial disease of the cardiovascular and lymphatic systems
Orientation - ARALprogram of Deped to the Parents.pptx
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
Final Presentation General Medicine 03-08-2024.pptx
Chinmaya Tiranga quiz Grand Finale.pdf
VCE English Exam - Section C Student Revision Booklet
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Microbial diseases, their pathogenesis and prophylaxis
2.FourierTransform-ShortQuestionswithAnswers.pdf
Complications of Minimal Access Surgery at WLH
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Cell Types and Its function , kingdom of life
Module 4: Burden of Disease Tutorial Slides S2 2025
O7-L3 Supply Chain Operations - ICLT Program
Microbial disease of the cardiovascular and lymphatic systems

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:
  • 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:
  • 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:
  • 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:
  • 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: