Ada 1
Ada 1
Algorithms
Topics
●
Introduction
●
Steps to Design & Analyze an algorithm
●
Important Problem Types
●
Algorithm Design Techniques
●
Algorithm Specification
●
Algorithm Analysis
Introduction
●
An algorithm is a finite set of instructions that if followed,
accomplishes a particular task
●
All algorithms must satisfy the following criteria:
– Input: must take zero or more inputs
– Output: must produce atleast one output
– Definiteness: each instruction must be unambiguous
– Finiteness: must terminate after finite number of
steps
– Effectiveness: instructions must be basic enough to
carry out using pencil and paper
Steps to design & analyze an algorithm
Important Problem Types
●
Some of the important problem types are:
– Sorting
– Searching
– String Processing: String Matching
– Graph Problems: Graph-Traversal, Shortest-Path, etc
– Combinatorial Problems: Knapsack, Subset
– Geometric Problems: Closest-pair, Convex-hull
– Numerical Problems: Integrals, Sys of Equations
Algorithm Design Techniques
●
An algorithm can be designed using approaches:
– Brute Force
– Decrease-and-Conquer
– Divide-and-Conquer
– Transform-and-Conquer
– Greedy Technique
– Dynamic Progrmming
– Backtracking
– Branch-and-Bound
Algorithm Specification
●
An algorithm can be specified using:
– Plain English (Natural Language)
– Flow Chart
– Pseudocode
Algorithm Analysis
●
An algorithm is analyzed for its efficiency
●
Efficiency can be:
– Space Efficiency: how much extra memory algorithm
uses
– Time Efficiency: how fast the algorithm runs