0% found this document useful (0 votes)
43 views

Problem Solving Tec

Uploaded by

paiprashanth92
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views

Problem Solving Tec

Uploaded by

paiprashanth92
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Introduction to problem solving

What is computer science?

“Computer science is a science of abstraction creating right model for for a problem and
devising appropriate mechanisable technique to solve it”

● Computers do jobs in faster and accurate manner

● A precise step- by-step set of instructions used to solve a problem-(definition for


algorithm)

● A clear definition, design of solution, and implementation of the design using a


programming language are the key factors that decides a successful computer
based problem solving

definition of problem solving


“ It is the process of identifying a problem, developing an algorithm for the problem
identified and implementing the algorithm in a programming language”
(or)
“ it is the process of identifying devising and implementing an algorithm for transforming
a less desirable condition that is the set of data to a more desirable one that is
information”

What is Garbage In Garbage Out? (GIGO)


It means the correctness of a program output depends upon the correctness of the input
provided.

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. It ends with a working solution in the form of a program called software


a. Problem definition
b. Problem analysis
c. Algorithm development
d. Coding
e. Testing and debugging
( draw figure 4.1 of text book and explain)

a. Analysis of the problem


1. It gives a clear understanding of the problem
2. It is noted that incorrect analysis failed give a correct solution
3. A proper study or analysis of the problem always helps us to identify the
various components in our expected new system
4. Systematic analysis will be helpful to figure out the proper inputs and the
required output.

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.

d. Testing and debugging


1. The programs are tested based on to various parameters, to know whether
it mat the requirements of the user
2. During testing we measure the overall time taken and the correctness of
the output for all possible inputs.
3. The logical errors are checked for wrong outputs
4. The errors are debugged and rectified. The program then is tested again.
This process continues until all errors are rectified or fixed.

Software testing methods:


a. Unit testing/component testing
/module testing
b. Integration testing
c. System testing
d. Acceptance testing

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

Algorithm is the first step in programming

Purpose:
a. Increased readability
b. Achieving accuracy
c. To obtain efficient solution

Characteristics of good algorithm

● Input : Every algorithm should receive some input, so as to make the system
open.

● Precision that is the definiteness


It means the steps in the algorithm are very clear and in detail.
The definitions should be correct and free from ambiguities

● 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.

● Output : Every algorithm should produce an output so as to make the system


open.

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?

● Focus on logic of solving a problem rather than implementation details.

● Flow of control should be revealed clearly during execution of the program

Flow chart :
Definition:A flowchart is defined as a diagrammatic (visual) representation of an
algorithm

What are the geometrical symbols used to make a flowchart? Explain


Flowchart uses geometrical symbols like ellipse/oval shape, rectangle, rhombus,
diamond, parallelogram, hexagon, circle and arrows

Ellipse/oval represents the functions start/end symbol.It is also called terminator symbol

Rectangle represents the function process. It is an action symbol. An action or a process


is also known as computation. Every rectangle will represent only one step of an
algorithm.

Diamond represents a decision.


The diamond symbol in a flowchart represents a branching point.
A true/false yes/no type of question is raised at the decision point and the path get split
into two branches based on the answer.
This symbol is also used in the implementation of a while loop or do while loop in an
algorithm.

The parallelogram represents input and output.


This is also called data 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.

The Circle acts as a connector between two predefined processes or subroutine.


It is also used as a feeder of loop control variables back to the hexagon in iterative
process.
ಮುಂದುವರಿಯುತ್ತದೆ……..

You might also like