Lecture - 02 - Fundamentals of Algorithmic Problem Solving
Lecture - 02 - Fundamentals of Algorithmic Problem Solving
3
Properties of an Algorithm
• Input: An algorithm requires one or more inputs. The values that are first supplied to the algorithm
before its processing are known as inputs. These inputs come from a predetermined range of
acceptable values.
• Output: One or more outputs must be produced by an algorithm. The output is the outcome of the
algorithm after every step has been completed. The relationship between the input and the result
should be clear.
• Precision: The steps must be precisely stated.
• Finiteness: An algorithm must terminate after a finite number of steps in all test cases. Every
instruction which contains a fundamental operator must be terminated within a finite amount of time.
• Definiteness: All instructions in an algorithm must be unambiguous, precise, and easy to interpret. By
referring to any of the instructions in an algorithm one can clearly understand what is to be done.
• Correctness: The algorithm should produce correct results for all possible input data.
• Generality: Rather than being limited to a single particular case, an algorithm should be able to solve a
group of issues. It should offer a generic fix that manages a variety of inputs inside a predetermined
range or domain.
4
Problem-Solving: An Art and a Science
• Problem-solving can be seen as more of an art than a science.
• Each person has different ways of approaching problems.
5
STAIR Steps for Solving Problems
• STAIR is an acronym designed to guide your problem-solving process.
• Each letter represents a critical step in developing a solution.
• S - State the problem
• T - Tools for the job
• A - Algorithm development
• I - Implementation of the algorithm
• R - Refinement