PMDS508L - Python Programming
Module – 1 – Algorithmic Problem Solving
Prepared by: Dr. Nandhini S, SAS
Algorithmic Problem solving has two phases:
1. Writing algorithm
2. Converting algorithm into code
History:
Data Structures and Data types:
• Algorithms provides the logic
• Data provides the values
• Program = Algorithm + Data structures
Characteristics of an Algorithm:
Pseudo code:
Flow charts:
Control Structures:
There are three kinds of control structures. They are:
Exercises:
1. A word is a palindrome if it reads the same when the order of its characters is
reversed. For instance, “123321”, “RADAR” and “step on no pets” are palindromes.
Derive an algorithm to determine if a word is a palindrome.
Solution:
2. Write an algorithm, pseudo code and flow chart to check the primality of a positive
number.
Algorithm:
Pseudo code:
Flowchart:
======================= END ==========================