SlideShare ist ein Scribd-Unternehmen logo
1 von 30
What is Algorithm
Programmer’s model of a computer
algorithms
 In programming, algorithm is a set of well defined
instructions in sequence to solve the problem.
 The correct sequence of instructions needed to
solve the corresponding problem.
 The term algorithm refers to the logic of a
program.
 It is a step by step description of how to arrive at
a solution to a given problem.
Characteristics
 Each instruction should be precise and
unambiguous.
 Each instruction should be executed in a finite
time.
 No instruction should repeat infinitely. This
ensures that the algorithm terminates ultimately.
 After executing the instructions (when the
algorithm terminates), the desired results are
obtained.
Sample Algorithm
 Problem1 :
 Fifty students in a class appeared in their final
examination. The division column of their mark
sheets contains the division(FIRST, SECOND,
THIRD or FAIL) obtained by them. If their mark
sheets are available with you, write an algorithm
to calculate and print the total number of students
who in FIRST division.
Algorithm Step
 Step 1: Initalize Total_First_Division and
Total_Marksheets_Checked to zero.
 Step 2: Take the mark sheet of the next student.
 Step 3: Check the division column of the mark sheet
to see if it is FIRST. If no, go to Step 5.
 Step 4: Add 1 to Total_First_Division.
 Step 5: Add 1 to Total_Marksheets_Checked.
 Step 6: Is Total_Marksheets_Checked=50?. If no,go
to Step 2.
 Step 7: Print Total_First_Division.
 Step 8 : Stop
Representation of Algorithm
 Commonly used ways to represent an algorithm are :
 As program
 As flowchart
 As pseudocode
Flow Chart
 A Flowchart is a pictorial representation of an
algorithm.
 Programmers often use it as a program-planning tool
for visually organizing a sequence of steps necessary
to solve a problem using a computer.
 It uses boxes of different shapes to denote different
types of instructions.
 Programmers write actual instructions within these
boxes using clear and concise statements.
 Direct solid lines connecting these boxes indicate flow
of operations – sequence in which to execute the
instructions.
 The process of drawing a flowchart for an algorithm is
known as flowcharting.
WHY USE FLOWCHARTS?
 Normally two steps 1. Algo 2. flowchart for preparing
program.
 Advantage of two steps approach in program writing
is that
 Programmer can concentate fully on the logic of the
solution to the problem at hand, without paying
attention to the syntax and other details of the
programming language.
 Flow chart shows the flow of operations in pictorial
form, a programmer can detect any error in the logic
with greater ease than in the case of a program.
 Once the flowchart is ready, the programmer can
concentrate on coding the operations in each box of
the flowchart as statements of the programming
language.
FLOWCHART SYMBOLS
 A flowchart uses boxes of different shapes to denote
different types of instructions.
 The use of symbols having standardized meanings
makes it easier to communicate program logic
through flowcharts.
Terminal Input/Output Processing
Decision Flow lines Connectors
 Terminal
 Input/Output
 Processing
 Decision
 Flow lines
 Connectors
Sample Flowchart
 1. A student appears for an examination
consisting of total 10 subjects with each subject
having maximum marks of 100. The student’s roll
number, name and marks obtained by him/her in
various subjects are input data.Such a collection
of related data items, treated as a unit, is known
as a record. Draw a flowchart for the algorithm to
calculate the percentage marks obtained by the
student, and to print it with his/her roll number
and name.
 2. Fifty students of a class appear in the
examination of below example1 .Draw a flowchart
for the algorithm to calculate and print the
percentage marks obtained by each student
along with his/her roll number and name.
 For the examination of below example1, we want
to make a list of only those students who passed
the examination (obtained 30% or more marks).
In the end, we also want to print the total number
of students who passed. A trailer record having
sentinel value of 9999999 for Rollno terminates
input data of all students. Draw a flowchart for an
algorithm to process this requirement.
 Input data of each student for the examination of
example1 also contains information regarding
his/her sex in a field named Sexcode having
value M (for male) or F(for female). We want to
make a list of only those female students who
passed in second division(obtained 45% or more
but less than 60% marks.) In the end, we also
want to print the total number of such students. A
trailer record having a sentinel value of Z for
Sexcode terminates input data of all students.
Draw a flowchart for an algorithm to process this
requirement.
Levels of Flowcharts
 There are no set standards on the amount of
detail required in flowchart.A flowchart that
outlines the main segments of a program (shows
only broad details) is a macro flowchart, and a
flowchart with more details is a micro
flowchart(also called detailed flowchart).

Flowcharting Rules
 The basic flowcharting rules and guidelines are as follows:
1. First chart the main line of logic, and then incorporate deatails.
2. Maintain a consistent level of details for a given flowchart.
3. Do not chart every detail in a flowchart; otherwise, the
flowchart will only be a graphic representation of all the steps
of the corresponding program. A reader interested in details
can refer to the program itself.
4. Use common statements that are easy to understand for words
within flowchart symbols. Use descriptive titles written in your
own language, rather than machine-oriented language.
5. Be consistent in using names and variables in a flowchart.
6. Go from left to right and top to bottom in constructing a
flowchart.
7. Keep a flowchart as simple as possible, and avoid crossing of
flow lines.
8. If you need a new page while drawing a flowchart, break the
flowchart at an input or output point. Moreover, use properly
labeled connectors to link portions of the flowchart on different
pages.
Advantage and Limitations of
Flowcharts
 Advantage
 Better communication
 Effective analysis
 Effective synthesis
 Proper program documentation
 Efficient coding
 Systematic debugging
 Systematic testings
Limitations
 Flowcharts are very time consuming and laborious to draw
with proper symbols and spacing, especially for large
complex programs. You can very well imagine how difficult
it would be to develop a detailed flowchart for a program
containing over 50000 statements.
 Any change and modification in program logic usually
requires a completely new flowchart. Redrawing a
flowchart being a tedious task
 Many companies use software tools that generate
flowcharts automatically from program code.
 This backward approach draws flowcharts from program
codes mainly for documentation purpose.
 There are no standards determining the amount of detail
that should be included in a flowchart.
 Because of such limitations, many organizations have
reduced the amount of flowcharting used. In its place they
use alternative tools for program analysis, two of which are
described below.
Bisection Method#include<stdio.h>
#define e 0.001
#define f(x) x*x*x -4*x +1
Void main()
{
float x0,x1,x2;
float f0,f1,f2;
clrscr();
printf(“Enter the values of x0 and x1”);
scanf(“%f%f”,&x0,&x1);
do{
f0 = f(x0);
f1 = f(x1);
x2=(x0+x1)/2;
f2=f(x2);
if(f0*f2<0)
{
x1=x2;
}
else
{
x0=x2;
}
i++;
printf(“No. of Iterations:=%d”,i);
printf(“Root:=%f”,x2);
printf(“Value of function =%fn”,f2);
}while(fabs(f2)<e);
getch();
}
Basic structure and functioning of
computers with a PC as as
illustrative example
Memory
Input Output Devices
Secondary Storage
Computer language
Operating system with DOS as an
example
 MS-DOS stands for Microsoft Disk Operating
System.
 It is a single-user operating system for IBM and
IBM compatible personal computers.
 Microsoft and IBM introduced it jointly in 1981.
 It was the most popular OS for personal
computers in the 1980’s .
 Because of its popularity,Microsoft later took a
decision to launch independently Microsoft
Windows operating system in 1990s.
Structure of MS-DOS
 MS-DOS has the following three layers:
1. BIOS 2. Kernel 3. Shell
 BIOS: stands for Basic Input Output System.
 It contains device drivers for standard devices such
as keyboard,disk,floppy, printer, and display monitor.
 It also contains basic low-level services such as time-
of-day and system configuration analysis.
 With hardware-dependent services in a BIOS, the
operating system ensures that it can offer other
higher-level operating system services in a hardware-
independent manner.
 This enables those operating system services to be
portable easily to other machines.
 Usually, computer manufecturers (not Microsoft)
supply the BIOS.
 Generally, the BIOS is located, in part, in a ROM,
which is a non-erasable memory.
BIOS
 When a user switches on a computer, the
computer’s hardware transfers control to the
bootstrap procedure of the BIOS in ROM.
 The bootstrap procedure carries out some
hardware tests to check whether the memory and
other hardware devices are functioning properly.
 If the hardware tests pass successfully, the
bootstrap procedure loads into memory a small
portion of the operating system from disk.
 This part of the operating system then loads the
rest of the mem
Introduction to UNIX and
WINDOWS
Data Processing
Principal of programming

Weitere ähnliche Inhalte

Was ist angesagt?

Programming process and flowchart
Programming process and flowchartProgramming process and flowchart
Programming process and flowcharthermiraguilar
 
La5 Basicelement
La5 BasicelementLa5 Basicelement
La5 BasicelementCma Mohd
 
Problem Solving Techniques
Problem Solving TechniquesProblem Solving Techniques
Problem Solving TechniquesAshesh R
 
Problem solving (C++ Programming)
Problem solving (C++ Programming)Problem solving (C++ Programming)
Problem solving (C++ Programming)Umair Younas
 
Introduction to Programming
Introduction to ProgrammingIntroduction to Programming
Introduction to ProgrammingChaffey College
 
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 - Introduction
Algorithm - IntroductionAlgorithm - Introduction
Algorithm - IntroductionMadhu Bala
 
Logic Formulation 2
Logic Formulation 2Logic Formulation 2
Logic Formulation 2deathful
 
The analysis synthesis model of compilation
The analysis synthesis model of compilationThe analysis synthesis model of compilation
The analysis synthesis model of compilationHuawei Technologies
 
Phases of the Compiler - Systems Programming
Phases of the Compiler - Systems ProgrammingPhases of the Compiler - Systems Programming
Phases of the Compiler - Systems ProgrammingMukesh Tekwani
 
Unit1 principle of programming language
Unit1 principle of programming languageUnit1 principle of programming language
Unit1 principle of programming languageVasavi College of Engg
 
Introduction to Computer and Programming - Lecture 03
Introduction to Computer and Programming - Lecture 03Introduction to Computer and Programming - Lecture 03
Introduction to Computer and Programming - Lecture 03hassaanciit
 
phases of compiler-analysis phase
phases of compiler-analysis phasephases of compiler-analysis phase
phases of compiler-analysis phaseSuyash Srivastava
 

Was ist angesagt? (20)

Programming process and flowchart
Programming process and flowchartProgramming process and flowchart
Programming process and flowchart
 
Algorithms
AlgorithmsAlgorithms
Algorithms
 
The Programming Process
The Programming ProcessThe Programming Process
The Programming Process
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
 
La5 Basicelement
La5 BasicelementLa5 Basicelement
La5 Basicelement
 
Problem Solving Techniques
Problem Solving TechniquesProblem Solving Techniques
Problem Solving Techniques
 
Problem solving (C++ Programming)
Problem solving (C++ Programming)Problem solving (C++ Programming)
Problem solving (C++ Programming)
 
Coding
CodingCoding
Coding
 
Introduction to Programming
Introduction to ProgrammingIntroduction to Programming
Introduction to Programming
 
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 - Introduction
Algorithm - IntroductionAlgorithm - Introduction
Algorithm - Introduction
 
Logic Formulation 2
Logic Formulation 2Logic Formulation 2
Logic Formulation 2
 
The analysis synthesis model of compilation
The analysis synthesis model of compilationThe analysis synthesis model of compilation
The analysis synthesis model of compilation
 
Phases of the Compiler - Systems Programming
Phases of the Compiler - Systems ProgrammingPhases of the Compiler - Systems Programming
Phases of the Compiler - Systems Programming
 
Unit1 principle of programming language
Unit1 principle of programming languageUnit1 principle of programming language
Unit1 principle of programming language
 
Training 8051Report
Training 8051ReportTraining 8051Report
Training 8051Report
 
Programming Fundamentals
Programming FundamentalsProgramming Fundamentals
Programming Fundamentals
 
Introduction to Computer and Programming - Lecture 03
Introduction to Computer and Programming - Lecture 03Introduction to Computer and Programming - Lecture 03
Introduction to Computer and Programming - Lecture 03
 
phases of compiler-analysis phase
phases of compiler-analysis phasephases of compiler-analysis phase
phases of compiler-analysis phase
 
Software tools
Software toolsSoftware tools
Software tools
 

Ähnlich wie Understanding Algorithms in 40 Characters

Ch1 principles of software development
Ch1 principles of software developmentCh1 principles of software development
Ch1 principles of software developmentHattori Sidek
 
Software develop....
Software develop.... Software develop....
Software develop.... GCWUS
 
PCCF UNIT 1.pptx
PCCF UNIT 1.pptxPCCF UNIT 1.pptx
PCCF UNIT 1.pptxDivyaKS12
 
Algorithm and Flowcharts
Algorithm and FlowchartsAlgorithm and Flowcharts
Algorithm and FlowchartsSURBHI SAROHA
 
Introduction to Computer Programming
Introduction to Computer ProgrammingIntroduction to Computer Programming
Introduction to Computer ProgrammingProf. Erwin Globio
 
GE3151 PSPP _Unit 1 notes and Question bank.pdf
GE3151 PSPP _Unit 1 notes and Question bank.pdfGE3151 PSPP _Unit 1 notes and Question bank.pdf
GE3151 PSPP _Unit 1 notes and Question bank.pdfAsst.prof M.Gokilavani
 
Programming_Lecture_1.pptx
Programming_Lecture_1.pptxProgramming_Lecture_1.pptx
Programming_Lecture_1.pptxshoaibkhan716300
 
PDLC.pptx
PDLC.pptxPDLC.pptx
PDLC.pptxmarysj3
 
Problem-solving and design 1.pptx
Problem-solving and design 1.pptxProblem-solving and design 1.pptx
Problem-solving and design 1.pptxTadiwaMawere
 
Algorithm and flowchart2010
Algorithm and flowchart2010Algorithm and flowchart2010
Algorithm and flowchart2010Jordan Delacruz
 
Introduction to computer science
Introduction to computer scienceIntroduction to computer science
Introduction to computer scienceumardanjumamaiwada
 
Program logic and design
Program logic and designProgram logic and design
Program logic and designChaffey College
 
System programming and implementation
System programming and implementationSystem programming and implementation
System programming and implementationJohn Todora
 
Program concep sequential statements
Program concep sequential statementsProgram concep sequential statements
Program concep sequential statementsankurkhanna
 

Ähnlich wie Understanding Algorithms in 40 Characters (20)

Ch1 principles of software development
Ch1 principles of software developmentCh1 principles of software development
Ch1 principles of software development
 
Software develop....
Software develop.... Software develop....
Software develop....
 
PCCF UNIT 1.pptx
PCCF UNIT 1.pptxPCCF UNIT 1.pptx
PCCF UNIT 1.pptx
 
Algorithm and Flowcharts
Algorithm and FlowchartsAlgorithm and Flowcharts
Algorithm and Flowcharts
 
Introduction to Computer Programming
Introduction to Computer ProgrammingIntroduction to Computer Programming
Introduction to Computer Programming
 
GE3151 PSPP _Unit 1 notes and Question bank.pdf
GE3151 PSPP _Unit 1 notes and Question bank.pdfGE3151 PSPP _Unit 1 notes and Question bank.pdf
GE3151 PSPP _Unit 1 notes and Question bank.pdf
 
Programming_Lecture_1.pptx
Programming_Lecture_1.pptxProgramming_Lecture_1.pptx
Programming_Lecture_1.pptx
 
PDLC.pptx
PDLC.pptxPDLC.pptx
PDLC.pptx
 
Problem-solving and design 1.pptx
Problem-solving and design 1.pptxProblem-solving and design 1.pptx
Problem-solving and design 1.pptx
 
pccf unit 1 _VP.pptx
pccf unit 1 _VP.pptxpccf unit 1 _VP.pptx
pccf unit 1 _VP.pptx
 
Algorithm and flowchart2010
Algorithm and flowchart2010Algorithm and flowchart2010
Algorithm and flowchart2010
 
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 Programming.docx
Introduction to Programming.docxIntroduction to Programming.docx
Introduction to Programming.docx
 
UNIT 2 ECSE-2.pptx
UNIT 2 ECSE-2.pptxUNIT 2 ECSE-2.pptx
UNIT 2 ECSE-2.pptx
 
Program logic and design
Program logic and designProgram logic and design
Program logic and design
 
System programming and implementation
System programming and implementationSystem programming and implementation
System programming and implementation
 
Introduction.pptx
Introduction.pptxIntroduction.pptx
Introduction.pptx
 
6272 cnote
6272 cnote6272 cnote
6272 cnote
 
Program concep sequential statements
Program concep sequential statementsProgram concep sequential statements
Program concep sequential statements
 

Mehr von mshoaib15

Msc prev completed
Msc prev completedMsc prev completed
Msc prev completedmshoaib15
 
Msc prev updated
Msc prev updatedMsc prev updated
Msc prev updatedmshoaib15
 
Msc chemistry previous
Msc chemistry previousMsc chemistry previous
Msc chemistry previousmshoaib15
 
Bsc math previous exam quetions
Bsc math previous exam quetionsBsc math previous exam quetions
Bsc math previous exam quetionsmshoaib15
 
Computer lab (programs)
Computer lab (programs)Computer lab (programs)
Computer lab (programs)mshoaib15
 
Boolean expression org.
Boolean expression org.Boolean expression org.
Boolean expression org.mshoaib15
 
Number system....
Number system....Number system....
Number system....mshoaib15
 

Mehr von mshoaib15 (8)

Msc prev completed
Msc prev completedMsc prev completed
Msc prev completed
 
Msc prev updated
Msc prev updatedMsc prev updated
Msc prev updated
 
Msc chemistry previous
Msc chemistry previousMsc chemistry previous
Msc chemistry previous
 
Bsc math previous exam quetions
Bsc math previous exam quetionsBsc math previous exam quetions
Bsc math previous exam quetions
 
Function
FunctionFunction
Function
 
Computer lab (programs)
Computer lab (programs)Computer lab (programs)
Computer lab (programs)
 
Boolean expression org.
Boolean expression org.Boolean expression org.
Boolean expression org.
 
Number system....
Number system....Number system....
Number system....
 

Kürzlich hochgeladen

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 

Kürzlich hochgeladen (20)

DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 

Understanding Algorithms in 40 Characters

  • 2. Programmer’s model of a computer algorithms  In programming, algorithm is a set of well defined instructions in sequence to solve the problem.  The correct sequence of instructions needed to solve the corresponding problem.  The term algorithm refers to the logic of a program.  It is a step by step description of how to arrive at a solution to a given problem.
  • 3. Characteristics  Each instruction should be precise and unambiguous.  Each instruction should be executed in a finite time.  No instruction should repeat infinitely. This ensures that the algorithm terminates ultimately.  After executing the instructions (when the algorithm terminates), the desired results are obtained.
  • 4. Sample Algorithm  Problem1 :  Fifty students in a class appeared in their final examination. The division column of their mark sheets contains the division(FIRST, SECOND, THIRD or FAIL) obtained by them. If their mark sheets are available with you, write an algorithm to calculate and print the total number of students who in FIRST division.
  • 5. Algorithm Step  Step 1: Initalize Total_First_Division and Total_Marksheets_Checked to zero.  Step 2: Take the mark sheet of the next student.  Step 3: Check the division column of the mark sheet to see if it is FIRST. If no, go to Step 5.  Step 4: Add 1 to Total_First_Division.  Step 5: Add 1 to Total_Marksheets_Checked.  Step 6: Is Total_Marksheets_Checked=50?. If no,go to Step 2.  Step 7: Print Total_First_Division.  Step 8 : Stop
  • 6. Representation of Algorithm  Commonly used ways to represent an algorithm are :  As program  As flowchart  As pseudocode
  • 7. Flow Chart  A Flowchart is a pictorial representation of an algorithm.  Programmers often use it as a program-planning tool for visually organizing a sequence of steps necessary to solve a problem using a computer.  It uses boxes of different shapes to denote different types of instructions.  Programmers write actual instructions within these boxes using clear and concise statements.  Direct solid lines connecting these boxes indicate flow of operations – sequence in which to execute the instructions.  The process of drawing a flowchart for an algorithm is known as flowcharting.
  • 8. WHY USE FLOWCHARTS?  Normally two steps 1. Algo 2. flowchart for preparing program.  Advantage of two steps approach in program writing is that  Programmer can concentate fully on the logic of the solution to the problem at hand, without paying attention to the syntax and other details of the programming language.  Flow chart shows the flow of operations in pictorial form, a programmer can detect any error in the logic with greater ease than in the case of a program.  Once the flowchart is ready, the programmer can concentrate on coding the operations in each box of the flowchart as statements of the programming language.
  • 9. FLOWCHART SYMBOLS  A flowchart uses boxes of different shapes to denote different types of instructions.  The use of symbols having standardized meanings makes it easier to communicate program logic through flowcharts. Terminal Input/Output Processing Decision Flow lines Connectors
  • 10.  Terminal  Input/Output  Processing  Decision  Flow lines  Connectors
  • 11. Sample Flowchart  1. A student appears for an examination consisting of total 10 subjects with each subject having maximum marks of 100. The student’s roll number, name and marks obtained by him/her in various subjects are input data.Such a collection of related data items, treated as a unit, is known as a record. Draw a flowchart for the algorithm to calculate the percentage marks obtained by the student, and to print it with his/her roll number and name.
  • 12.  2. Fifty students of a class appear in the examination of below example1 .Draw a flowchart for the algorithm to calculate and print the percentage marks obtained by each student along with his/her roll number and name.
  • 13.  For the examination of below example1, we want to make a list of only those students who passed the examination (obtained 30% or more marks). In the end, we also want to print the total number of students who passed. A trailer record having sentinel value of 9999999 for Rollno terminates input data of all students. Draw a flowchart for an algorithm to process this requirement.
  • 14.  Input data of each student for the examination of example1 also contains information regarding his/her sex in a field named Sexcode having value M (for male) or F(for female). We want to make a list of only those female students who passed in second division(obtained 45% or more but less than 60% marks.) In the end, we also want to print the total number of such students. A trailer record having a sentinel value of Z for Sexcode terminates input data of all students. Draw a flowchart for an algorithm to process this requirement.
  • 15. Levels of Flowcharts  There are no set standards on the amount of detail required in flowchart.A flowchart that outlines the main segments of a program (shows only broad details) is a macro flowchart, and a flowchart with more details is a micro flowchart(also called detailed flowchart). 
  • 16. Flowcharting Rules  The basic flowcharting rules and guidelines are as follows: 1. First chart the main line of logic, and then incorporate deatails. 2. Maintain a consistent level of details for a given flowchart. 3. Do not chart every detail in a flowchart; otherwise, the flowchart will only be a graphic representation of all the steps of the corresponding program. A reader interested in details can refer to the program itself. 4. Use common statements that are easy to understand for words within flowchart symbols. Use descriptive titles written in your own language, rather than machine-oriented language. 5. Be consistent in using names and variables in a flowchart. 6. Go from left to right and top to bottom in constructing a flowchart. 7. Keep a flowchart as simple as possible, and avoid crossing of flow lines. 8. If you need a new page while drawing a flowchart, break the flowchart at an input or output point. Moreover, use properly labeled connectors to link portions of the flowchart on different pages.
  • 17. Advantage and Limitations of Flowcharts  Advantage  Better communication  Effective analysis  Effective synthesis  Proper program documentation  Efficient coding  Systematic debugging  Systematic testings
  • 18. Limitations  Flowcharts are very time consuming and laborious to draw with proper symbols and spacing, especially for large complex programs. You can very well imagine how difficult it would be to develop a detailed flowchart for a program containing over 50000 statements.  Any change and modification in program logic usually requires a completely new flowchart. Redrawing a flowchart being a tedious task  Many companies use software tools that generate flowcharts automatically from program code.  This backward approach draws flowcharts from program codes mainly for documentation purpose.  There are no standards determining the amount of detail that should be included in a flowchart.  Because of such limitations, many organizations have reduced the amount of flowcharting used. In its place they use alternative tools for program analysis, two of which are described below.
  • 19. Bisection Method#include<stdio.h> #define e 0.001 #define f(x) x*x*x -4*x +1 Void main() { float x0,x1,x2; float f0,f1,f2; clrscr(); printf(“Enter the values of x0 and x1”); scanf(“%f%f”,&x0,&x1); do{ f0 = f(x0); f1 = f(x1); x2=(x0+x1)/2; f2=f(x2); if(f0*f2<0) { x1=x2; } else { x0=x2; } i++; printf(“No. of Iterations:=%d”,i); printf(“Root:=%f”,x2); printf(“Value of function =%fn”,f2); }while(fabs(f2)<e); getch(); }
  • 20. Basic structure and functioning of computers with a PC as as illustrative example
  • 25. Operating system with DOS as an example  MS-DOS stands for Microsoft Disk Operating System.  It is a single-user operating system for IBM and IBM compatible personal computers.  Microsoft and IBM introduced it jointly in 1981.  It was the most popular OS for personal computers in the 1980’s .  Because of its popularity,Microsoft later took a decision to launch independently Microsoft Windows operating system in 1990s.
  • 26. Structure of MS-DOS  MS-DOS has the following three layers: 1. BIOS 2. Kernel 3. Shell  BIOS: stands for Basic Input Output System.  It contains device drivers for standard devices such as keyboard,disk,floppy, printer, and display monitor.  It also contains basic low-level services such as time- of-day and system configuration analysis.  With hardware-dependent services in a BIOS, the operating system ensures that it can offer other higher-level operating system services in a hardware- independent manner.  This enables those operating system services to be portable easily to other machines.  Usually, computer manufecturers (not Microsoft) supply the BIOS.  Generally, the BIOS is located, in part, in a ROM, which is a non-erasable memory.
  • 27. BIOS  When a user switches on a computer, the computer’s hardware transfers control to the bootstrap procedure of the BIOS in ROM.  The bootstrap procedure carries out some hardware tests to check whether the memory and other hardware devices are functioning properly.  If the hardware tests pass successfully, the bootstrap procedure loads into memory a small portion of the operating system from disk.  This part of the operating system then loads the rest of the mem
  • 28. Introduction to UNIX and WINDOWS