SlideShare a Scribd company logo
Lecture 6
Architecture
Algorithm Definition
Algorithm
1stDefinition:
Sequence of steps that can be taken to solve a problem
2ndDefinition:
The step by step series of activities performed in a sequence
to solve a problem
Better Definition:
A precise sequence of a limited number of unambiguous,
executable steps that terminates in the form of a solution
Why Algorithms are Useful?
•Once we find an algorithm for solving a problem, we
do not need to re-discover it the next time we are
faced with that problem
•Once an algorithm is known, the task of solving the
problem reduces to following (almost blindly and
without thinking) the instructions precisely
•All the knowledge required for solving the problem is
present in the algorithm
Origin of the Term “Algorithm”
 The name derives from the title of a Latin book:
Algoritmi de numero Indorum
 That book was written by the famous 9-th century
Muslim mathematician, Muhammad ibn Musa al-
Khwarizmi
 The study of algorithms began with mathematicians
and was a significant area of work in the early years
Al-Khwarizmi’s Golden Principle
All complex problems can be and must be solved
using the following simple steps:
 Break down the problem into small, simple sub-
problems
 Arrange the sub-problems in such an order that each
of them can be solved without effecting any other
 Solve them separately, in the correct order
 Combine the solutions of the sub-problems to form
the solution of the original problem
Algorithm for Decimal to Binary
Conversion
 Write the decimal number
 Divide by 2; write quotient and remainder
 Repeat step 2 on the quotient; keep on repeating
until the quotient becomes zero
 Write all remainder digits in the reverse order (last
remainder first) to form the final result
Remember
 The process consists of repeated application of
simple steps
 All steps are unambiguous (clearly defined)
 We are capable of doing all those steps
 Only a limited no. of steps needs to be taken
 Once all those steps are taken according to the
prescribed sequence, the required result will be
found
 Moreover, the process will stop at that point
Three Requirements
Sequence is:
 Precise
Consists of a limited number of steps
Each step is:
 Unambiguous
 Executable
The sequence of steps terminates in the form of a
solution
Analysis of Algorithms
 Analysis in the context of algorithms is concerned
with predicting the resources that re requires:
 Computational time
 Memory
 Bandwidth
 Logic functions
However, Time – generally measured in terms of the
number of steps required to execute an algorithm - is
the resource of most interest. By analyzing several
candidate algorithms, the most efficient one(s) can
be identified
Selecting Among Algorithms
 When choosing among competing, successful
solutions to a problem, choose the one which is the
least complex
 This principle is called the “Ockham’s Razor,” after
William of Ockham - famous 13-th century English
philosopher
Types of Algorithms
Greedy Algorithm
 An algorithm that always takes the best immediate,
or local solution while finding an answer
 Greedy algorithms may find the overall or globally
optimal solution for some optimization problems, but
may find less-than-optimal solutions for some
instances of other problems
 KEY ADVANTAGE: Greedy algorithms are usually
faster, since they don't consider the details of
possible alternatives
Deterministic Algorithm
 An algorithm whose behavior can be completely
predicted from the inputs
 That is, each time a certain set of input is presented,
the algorithm gives the same results as any other
time the set of input is presented.
Types of Algorithms
Randomized Algorithm
 Any algorithm whose behavior is not only determined
by the input, but also values produced by a random
number generator
 These algorithms are often simpler and more
efficient than deterministic algorithms for the same
problem
 Simpler algorithms have the advantages of being
easier to analyze and implement.
Types of Algorithms
Travelling Salesman Problem
The Brute Force Strategy
 A strategy in which all possible combinations are
examined and the best among them is selected
 What is the problem with this approach?
 A: Doesn’t scale well with the size of the problem
 How many possible city sequences for n=6? For
n=60? For n=600?
Syntax & Semantics
Algorithm Representation
 Flow chart
 Pseudo code
 Actual code
Flow chart
 A graphical representation of a process (e.g. an
algorithm), in which graphic objects are used to
indicate the steps & decisions that are taken as the
process moves along from start to finish
 Individual steps are represented by boxes and other
shapes on the flowchart, with arrows between those
shapes indicating the order in which the steps are
taken
Flowchart Elements
Ic lecture6 architecture and algo
Ic lecture6 architecture and algo

More Related Content

What's hot (20)

PPT
Daa presentation 97
Garima Verma
 
PPTX
"A short and knowledgeable concept about Algorithm "
CHANDAN KUMAR
 
PPTX
Lecture 1-cs648
Anshul Yadav
 
PDF
Design & Analysis of Algorithms Lecture Notes
FellowBuddy.com
 
PDF
Algorithm defination, design & Implementation
Bilal Maqbool ツ
 
PPTX
Notion of an algorithm
Nisha Soms
 
PPTX
Types of algorithms
Amelita Martinez
 
PDF
ADA complete notes
Vinay Kumar C
 
PPTX
Topic 1.4: Randomized Algorithms
KM Bappi
 
PPSX
Ds03 algorithms jyoti lakhani
jyoti_lakhani
 
PPT
Randomized Algorithms
Ketan Kamra
 
PPT
What is an algorithm?
Startup Product Academy, LLC
 
PPT
Aad introduction
Mr SMAK
 
PPT
Programming aids- Algorithm, Flowchart, Pseudocodes and Decision table
Anjali Technosoft
 
PPTX
Dynamic Programming
paramalways
 
PPTX
Algorithm
IHTISHAM UL HAQ
 
PPT
35 algorithm-types
Kislay Bhardwaj L|PT,ECSA,C|EH
 
PDF
Ada notes
VIKAS SINGH BHADOURIA
 
PPTX
Algorithms : Introduction and Analysis
Dhrumil Patel
 
Daa presentation 97
Garima Verma
 
"A short and knowledgeable concept about Algorithm "
CHANDAN KUMAR
 
Lecture 1-cs648
Anshul Yadav
 
Design & Analysis of Algorithms Lecture Notes
FellowBuddy.com
 
Algorithm defination, design & Implementation
Bilal Maqbool ツ
 
Notion of an algorithm
Nisha Soms
 
Types of algorithms
Amelita Martinez
 
ADA complete notes
Vinay Kumar C
 
Topic 1.4: Randomized Algorithms
KM Bappi
 
Ds03 algorithms jyoti lakhani
jyoti_lakhani
 
Randomized Algorithms
Ketan Kamra
 
What is an algorithm?
Startup Product Academy, LLC
 
Aad introduction
Mr SMAK
 
Programming aids- Algorithm, Flowchart, Pseudocodes and Decision table
Anjali Technosoft
 
Dynamic Programming
paramalways
 
Algorithm
IHTISHAM UL HAQ
 
35 algorithm-types
Kislay Bhardwaj L|PT,ECSA,C|EH
 
Algorithms : Introduction and Analysis
Dhrumil Patel
 

Similar to Ic lecture6 architecture and algo (20)

PPSX
Design and Analysis of Algorithms ppt by K. Adi
Prof. Dr. K. Adisesha
 
PPT
Types of Algorithms.ppt
ALIZAIB KHAN
 
PDF
DAA INTRO.pdf of design analysis algorithms
VaishnaviDappu
 
DOCX
Algorithm - A set of rules for solving operations
Kumari99
 
PPTX
CH-1.1 Introduction (1).pptx
satvikkushwaha1
 
PPTX
Algo_Lecture01.pptx
ShaistaRiaz4
 
PPTX
Algorithm.pptx
DipayanSadhu1
 
PPTX
IntroductionToAlgo_v1_1709293290768 (2).pptx
prasanna220904
 
PPTX
Introduction to Algorithms Introduction to Algorithms.pptx
ArjayBalberan1
 
PDF
19IS402_LP1_LM_22-23.pdf
GOWTHAMR721887
 
PDF
2-Algorithms and Complexit data structurey.pdf
ishan743441
 
PPTX
DAA 1 ppt.pptx
RAJESH S
 
PPTX
DAA ppt.pptx
RAJESH S
 
PPTX
mmmmmmm
Kawsar Ahmed
 
PPTX
Design and Analysis of Algorithm for II year Computer science and Engineering...
Kalpana Devi M
 
PPTX
DA lecture 3.pptx
SayanSen36
 
PDF
Algorithms
Ramy F. Radwan
 
PPT
Lecture 01-2.ppt
RaoHamza24
 
PPTX
Unit 2 algorithm
Dabbal Singh Mahara
 
PPTX
2-Algorithms and Complexity analysis.pptx
231b209
 
Design and Analysis of Algorithms ppt by K. Adi
Prof. Dr. K. Adisesha
 
Types of Algorithms.ppt
ALIZAIB KHAN
 
DAA INTRO.pdf of design analysis algorithms
VaishnaviDappu
 
Algorithm - A set of rules for solving operations
Kumari99
 
CH-1.1 Introduction (1).pptx
satvikkushwaha1
 
Algo_Lecture01.pptx
ShaistaRiaz4
 
Algorithm.pptx
DipayanSadhu1
 
IntroductionToAlgo_v1_1709293290768 (2).pptx
prasanna220904
 
Introduction to Algorithms Introduction to Algorithms.pptx
ArjayBalberan1
 
19IS402_LP1_LM_22-23.pdf
GOWTHAMR721887
 
2-Algorithms and Complexit data structurey.pdf
ishan743441
 
DAA 1 ppt.pptx
RAJESH S
 
DAA ppt.pptx
RAJESH S
 
mmmmmmm
Kawsar Ahmed
 
Design and Analysis of Algorithm for II year Computer science and Engineering...
Kalpana Devi M
 
DA lecture 3.pptx
SayanSen36
 
Algorithms
Ramy F. Radwan
 
Lecture 01-2.ppt
RaoHamza24
 
Unit 2 algorithm
Dabbal Singh Mahara
 
2-Algorithms and Complexity analysis.pptx
231b209
 
Ad

More from AttaullahRahimoon (13)

PPSX
Lecture 14-15-16-presentation skills and tips
AttaullahRahimoon
 
PPSX
Lecture 11a-
AttaullahRahimoon
 
PPSX
Lecture 5
AttaullahRahimoon
 
PPT
Lecture 1 a
AttaullahRahimoon
 
PPSX
Ict lecture11b,12,13
AttaullahRahimoon
 
PPSX
Ict lecture9 10
AttaullahRahimoon
 
PPSX
Ic lecture8
AttaullahRahimoon
 
PPSX
Ic lecture7
AttaullahRahimoon
 
PPSX
Ic lecture4
AttaullahRahimoon
 
PPSX
Ic lecture3
AttaullahRahimoon
 
PPSX
Ic lecture2
AttaullahRahimoon
 
PPSX
Ic lecture1
AttaullahRahimoon
 
PPTX
Active and passive
AttaullahRahimoon
 
Lecture 14-15-16-presentation skills and tips
AttaullahRahimoon
 
Lecture 11a-
AttaullahRahimoon
 
Lecture 1 a
AttaullahRahimoon
 
Ict lecture11b,12,13
AttaullahRahimoon
 
Ict lecture9 10
AttaullahRahimoon
 
Ic lecture8
AttaullahRahimoon
 
Ic lecture7
AttaullahRahimoon
 
Ic lecture4
AttaullahRahimoon
 
Ic lecture3
AttaullahRahimoon
 
Ic lecture2
AttaullahRahimoon
 
Ic lecture1
AttaullahRahimoon
 
Active and passive
AttaullahRahimoon
 
Ad

Recently uploaded (20)

PDF
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
PPTX
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
PPT
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
PPTX
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
PDF
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
PPTX
PPT-Q1-WEEK-3-SCIENCE-ERevised Matatag Grade 3.pptx
reijhongidayawan02
 
PDF
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
PPTX
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
PPTX
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
PDF
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
PDF
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
PDF
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
PDF
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
PDF
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
PPTX
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
PDF
The Different Types of Non-Experimental Research
Thelma Villaflores
 
PPTX
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
PPTX
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
PPTX
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
PPTX
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 
Generative AI: it's STILL not a robot (CIJ Summer 2025)
Paul Bradshaw
 
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
How to Convert an Opportunity into a Quotation in Odoo 18 CRM
Celine George
 
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
PPT-Q1-WEEK-3-SCIENCE-ERevised Matatag Grade 3.pptx
reijhongidayawan02
 
Aprendendo Arquitetura Framework Salesforce - Dia 03
Mauricio Alexandre Silva
 
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
How to Create Odoo JS Dialog_Popup in Odoo 18
Celine George
 
Reconstruct, Restore, Reimagine: New Perspectives on Stoke Newington’s Histor...
History of Stoke Newington
 
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
Exploring the Different Types of Experimental Research
Thelma Villaflores
 
ARAL-Orientation_Morning-Session_Day-11.pdf
JoelVilloso1
 
QNL June Edition hosted by Pragya the official Quiz Club of the University of...
Pragya - UEM Kolkata Quiz Club
 
How to Set Up Tags in Odoo 18 - Odoo Slides
Celine George
 
The Different Types of Non-Experimental Research
Thelma Villaflores
 
Identifying elements in the story. Arrange the events in the story
geraldineamahido2
 
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
Post Dated Cheque(PDC) Management in Odoo 18
Celine George
 

Ic lecture6 architecture and algo

  • 2. Algorithm 1stDefinition: Sequence of steps that can be taken to solve a problem 2ndDefinition: The step by step series of activities performed in a sequence to solve a problem Better Definition: A precise sequence of a limited number of unambiguous, executable steps that terminates in the form of a solution
  • 3. Why Algorithms are Useful? •Once we find an algorithm for solving a problem, we do not need to re-discover it the next time we are faced with that problem •Once an algorithm is known, the task of solving the problem reduces to following (almost blindly and without thinking) the instructions precisely •All the knowledge required for solving the problem is present in the algorithm
  • 4. Origin of the Term “Algorithm”  The name derives from the title of a Latin book: Algoritmi de numero Indorum  That book was written by the famous 9-th century Muslim mathematician, Muhammad ibn Musa al- Khwarizmi  The study of algorithms began with mathematicians and was a significant area of work in the early years
  • 5. Al-Khwarizmi’s Golden Principle All complex problems can be and must be solved using the following simple steps:  Break down the problem into small, simple sub- problems  Arrange the sub-problems in such an order that each of them can be solved without effecting any other  Solve them separately, in the correct order  Combine the solutions of the sub-problems to form the solution of the original problem
  • 6. Algorithm for Decimal to Binary Conversion  Write the decimal number  Divide by 2; write quotient and remainder  Repeat step 2 on the quotient; keep on repeating until the quotient becomes zero  Write all remainder digits in the reverse order (last remainder first) to form the final result
  • 7. Remember  The process consists of repeated application of simple steps  All steps are unambiguous (clearly defined)  We are capable of doing all those steps  Only a limited no. of steps needs to be taken  Once all those steps are taken according to the prescribed sequence, the required result will be found  Moreover, the process will stop at that point
  • 8. Three Requirements Sequence is:  Precise Consists of a limited number of steps Each step is:  Unambiguous  Executable The sequence of steps terminates in the form of a solution
  • 9. Analysis of Algorithms  Analysis in the context of algorithms is concerned with predicting the resources that re requires:  Computational time  Memory  Bandwidth  Logic functions However, Time – generally measured in terms of the number of steps required to execute an algorithm - is the resource of most interest. By analyzing several candidate algorithms, the most efficient one(s) can be identified
  • 10. Selecting Among Algorithms  When choosing among competing, successful solutions to a problem, choose the one which is the least complex  This principle is called the “Ockham’s Razor,” after William of Ockham - famous 13-th century English philosopher
  • 11. Types of Algorithms Greedy Algorithm  An algorithm that always takes the best immediate, or local solution while finding an answer  Greedy algorithms may find the overall or globally optimal solution for some optimization problems, but may find less-than-optimal solutions for some instances of other problems  KEY ADVANTAGE: Greedy algorithms are usually faster, since they don't consider the details of possible alternatives
  • 12. Deterministic Algorithm  An algorithm whose behavior can be completely predicted from the inputs  That is, each time a certain set of input is presented, the algorithm gives the same results as any other time the set of input is presented. Types of Algorithms
  • 13. Randomized Algorithm  Any algorithm whose behavior is not only determined by the input, but also values produced by a random number generator  These algorithms are often simpler and more efficient than deterministic algorithms for the same problem  Simpler algorithms have the advantages of being easier to analyze and implement. Types of Algorithms
  • 15. The Brute Force Strategy  A strategy in which all possible combinations are examined and the best among them is selected  What is the problem with this approach?  A: Doesn’t scale well with the size of the problem  How many possible city sequences for n=6? For n=60? For n=600?
  • 17. Algorithm Representation  Flow chart  Pseudo code  Actual code
  • 18. Flow chart  A graphical representation of a process (e.g. an algorithm), in which graphic objects are used to indicate the steps & decisions that are taken as the process moves along from start to finish  Individual steps are represented by boxes and other shapes on the flowchart, with arrows between those shapes indicating the order in which the steps are taken