1.Steps in Problem Solving
1.Steps in Problem Solving
PROGRAMMING
TECHNIQUES
TECHNIQUES
Unit - 1
Topics included
• Steps Involved in Computer
Programming
• Problem Definition
• Outlining The Solution
• Flow Chart
• Developing Algorithms
• Efficiency of Algorithms
• Analysis of Algorithms.
Introduction about
Problems
Computers everywhere
11
Strategies
Ask questions!
– What do I know about the problem?
– What is the information that I have to
process in order the find the solution?
– What does the solution look like?
– What sort of special cases exist?
– How will I recognize that I have found
the solution?
12
Strategies
Ask questions! Never reinvent the
wheel!
Similar problems come up again and
again in different guises
A good programmer recognizes a task or
subtask that has been solved before and
plugs in the solution
13
Strategies
Divide and Conquer!
Break up a large problem into smaller
units and solve each smaller problem
– Applies the concept of abstraction
– The divide-and-conquer approach can be
applied over and over again until each
subtask is manageable
14
Program
A set of explicit and
unambiguous instructions
expressed in a programming
language. That set of instructions
are called a program.
Algorithms
Algorithm
A set of unambiguous instructions for
solving a problem or subproblem in a
finite amount of time using a finite
amount of data
16
Six steps to ensure a Best decision in PROBLEM
SOLVING
19
Phase Interactions
20
ALL THIS SUMMED UP
INTO 8 STEPS
• Problem definition Analysis and Specification
Phase
•Debugging
•Testing
•Maintenance
Problem definition
•It involves developing the specifications of the problem.
24
Top-Down Design
Top-Down Design
Problem-solving technique in which the problem is
divided
into subproblems; the process is applied to each
subproblem
Modules
Self-contained collection of steps, that solve a
problem
or subproblem
Abstract Step
An algorithmic step containing unspecified details
Concrete Step
An algorithmic step in which all details are specified
25
Top-Down Design
Figure 6.5
An example
of top-down
design
26
A General Example
Mathematics
We tests the answer
Programs
We test the process
30
TESTING
• It should be done to report that whether
the problem has met its desired
requirements or not.