Lecture5_Algorithm Writing and Analysis
Lecture5_Algorithm Writing and Analysis
(DSAs)
Lecture 5
Outline
Overview
Algorithm Categories
Algorithm Properties
Structure of an Algorithm
Writing Algorithms
Algorithm Analysis
Asymptotic Analysis
Reasons for Analysis of Algorithms
Greedy Algorithm
Overview
Algorithm is a step-by-step procedure, which
defines a set of instructions to be executed in a
certain order to get the desired output.
Ο Notation
Ω Notation
θ Notation
Big Oh Notation, O
The notation Ο(n) is the formal way to express
the upper bound of an algorithm's running time.
It measures the worst case time complexity or
the longest amount of time an algorithm can
possibly take to complete.
Examples
Most networking algorithms use the greedy approach. Here is a list of
few of them −
Travelling Salesman Problem
Prim's Minimal Spanning Tree Algorithm
Kruskal's Minimal Spanning Tree Algorithm
Dijkstra's Minimal Spanning Tree Algorithm
Graph - Map Coloring
Graph - Vertex Cover
Knapsack Problem
Job Scheduling Problem
There are lots of similar problems that uses the greedy approach to
find an optimum
solution.
Questions