L3 - Fundamentals of Algo Problem Solving
L3 - Fundamentals of Algo Problem Solving
&
Analysis
of
Algorithms
Lecture 3
Fundamentals of
Algorithmic
Problem Solving
Fundamentals of Algorithmic
Problem Solving
Understanding the Problem
Problem Description
few small examples by hand
think about special cases
ask questions again if needed
Inputs
Your algorithm may work correctly for a majority of
inputs but crash on some “boundary” value.
Remember that a correct algorithm is not one that
works most of the time, but one that works correctly for
all legitimate inputs.
Ascertaining the Capabilities of the
Computational Device
NO
Exact Algorithms
Approximate Algorithms
Example:
The sieve of Eratosthenes would run longer if
we used a linked list instead of an array in its
implementation (Why?).
Google the Answer
Methods of Specifying an Algorithm