3. Group Name: Study 360°
Group Members
Sohan Ahmed
ID:1589
Md Sallahuddin
ID:1587
SM Tashdeed
ID:1575
Ahsanul Adeeb
ID:1562
4. Content
•Definition of algorithm
•Criteria to Satisfy
•Convention for writing Pseudocode
•Performance analysis of algorithm
•Asymptotic Notation
1. Big Oh (O)
2. Omega (Ω)
3. Theta (θ)
•Randomized Algorothm
5. Definition of algorithm
An Algorithm is composed of a finite set of step
each of which may require one or more
operations. It is a finite set of instructions that if
followed, accomplished a particular task
6. Criteria to Satisfy
•Input : Zero or more quantity are externally supplied.
•Output : At least one quantity is produced.
•Definiteness : Each Instructions is clear an unambiguous
•Finiteness : If we trace out the instructions of an algorithm,
then for all cases, the algorithm terminate often a
finite number of steps.
•Effectiveness :Every instruction must be very basic so that it
can be carried out in principle by a person
7. Conventions for
Pseudocode
1.Comments begin with // and contain until the end of line
Ex ://………….Sohan is boss…..//
2:Blocks are indicated with matching braces {and}
3:An Identifier begins with a letter, compound data types can be formed with
record here is example
Node=record
{
Datatype_1 data_1
:
Datatype_2 datatype_2
node * link;
}
9. TiTtle Sequence Frequency Total steps
Algorithm Fibonacci (A,n) 0 0 0
{ 0 1 1
F: = 0 ; 1 1 0
S: = 1 ; 1 1 1
for i = 0 to n do 1 n+1 n+1
{ 0 1 0
T = F + S; 1 n n
F: = S; 1 n n
S: = T; 1 n n
} 0 1 0
write (F); 1 1 1
} 0 1 0
TIME COMPLEXITY OF FIBONACCI Total = 4n+4
Time Complexity
10. ASYMPTOTIC NOTATION
1. Big Oh (O)
2. Omega (Ω)
3. Theta (θ)
BIG OH [O]
Big Oh (O): Big Oh O(n) is called worst case of a
algorithm.
an + c = O(n)
If an + c ≤ (a+1)n for all n ≥ c
Example: 3n+2 = O(n)
if. 3n + c ≤ 4n for all n ≥ 2
n = 2 ; 8 ≤ 8
n = 3 ; 11 ≤ 12
11. OMEGA [Ω]
Omega (Ω) is called best case of an
algorithm
an + c = Ω (n)
Iff an + c ≥ an for all n ≥1
Example : 3n + 2 = Ω (n)
Iff 3n + 2 ≥ 3n for all n ≥ 1
THETA [Θ]
Theta (θ) is called precise case /
average case of an algorithm
an + c = θ(n)
1. Iff an + c ≥ an for all n ≥ c
12. Randomized Algorithm
Randomized algorithms: make random choices during
run.
Main benefits:
➢Speed: may be faster than any deterministic.
➢Even if not faster, often simpler ( quicksort)
➢Sometimes, randomized idea leads to
deterministic algorithm