Problem Solving Tec
Problem Solving Tec
“Computer science is a science of abstraction creating right model for for a problem and
devising appropriate mechanisable technique to solve it”
For example: if we have a program to add three single digit numbers then if at least one
of the inputs contains special characters or alphabets it leads to wrong output however
good the algorithm is.
a. A problem solving always begins with identification of the problem that is problem
definition
b. Developing an algorithm
1. At this stage a solution to a problem is devised in a natural language
2. The solution is provided in the form of a precise
step-by-step set of called an algorithm
3. The tentative algorithm obtained is successively refined to capture all the
expects of the desired solution
4. It is possible to have more than one algorithm for a problem but our job is
to select the most suitable one which leads to the desired solution
5. An algorithm can be represented either by a pseudocode or flowchart
c. Coding
1. At this stage we convert the selected algorithm into a format
understandable to the computer to generate the desired solution
2. Coding can be done either using high level languages like C/C++ /Java/
Python etc.
It can be in low level like Assembly language also.
Note: Customer support is the very important stage in problem solving, here the
software vendor team continuously spends time to fix bugs which appear in the
operational field.
Algorithm
Definition:
● A precise step- by-step set of instructions used to solve a problem
Purpose:
a. Increased readability
b. Achieving accuracy
c. To obtain efficient solution
● Input : Every algorithm should receive some input, so as to make the system
open.
● Uniqueness:
It refers to the effectiveness of
the algorithm, that is every step should be uniquely defined and the output of each
step depends only on the result of preceding step(s) and the initial inputs.
● Finiteness :
An algorithm should terminate after a definite number of steps.
What are the most important things to be identified while writing an algorithm?
● User input
● Computational process
● Output desired by the user
what are the things to be remembered while writing pseudo code or drawing a flow chart
represent an algorithm?
Flow chart :
Definition:A flowchart is defined as a diagrammatic (visual) representation of an
algorithm
Ellipse/oval represents the functions start/end symbol.It is also called terminator symbol
—------------->
Arrow represents the order/direction of flow between one one shape and another shape
representing a step in an algorithm.
The hexagon represents preparation or iteration. The symbol is very much helpful to
represent fixed execution loops in an algorithm.