Algorithms
Lecture # 01
Preliminaries
Origin of Word: ALGORITHM
Origin of Word: ALGORITHM
Origin of Word: ALGORITHM
Origin of Word: ALGORITHM
ALGORITHM informal definition
definition
Algorithm consists of well defined steps,
executed in particular order to solve a
computing problem
Any computing problem can be solved by
executing a series of actions in a specific
order, that is called algorithm
definition
Algorithm is a function or procedure
Which takes an input and produces some output
ALGORITHM, programming
ALGORITHM, programming
Why Study?
Data structures was about how to dealt with
good data structures.
Fastest algorithms are fast because they use
fastest data structures
Why Study?
Why Study?
Why Study?
Course outline
Course outline
Course outline
Course outline
Criteria for analyzing Algorithms
Criteria for analyzing Algorithms
Algorithm Writing..
Itshould be language independent
Algorithm can be written in any manner
unless they provide the solution of a
problem
Two styles are normally used
Pseudo-code
Flow Chart
Algorithms (Pseudo-code
Algorithms (Flowchart)
Algorithms (Code)
void bubbleSort(int Size, number[]){
for(int i=0;i<Size-1;i++){
for(int j=0;j<Size-1;j++){
if(number[j]<number[j+1]){
int temp=number[j];
number[j]=number[j+1];
number[j+1]=temp;
}
}
}
Model of Computation
Model of Computation
Model of Computation
Random Access Machine