INTRODUCTION TO Problem Solving: Ppa (Unit - 5)
INTRODUCTION TO Problem Solving: Ppa (Unit - 5)
INTRODUCTION TO Problem Solving: Ppa (Unit - 5)
Trial and error is used best when it is applied to situations that give
your large amounts of time and safety to come up with a solution.
For example :while trial and error may be excellent in finding solutions
to mechanical or engineering problems.
Advantages :
It does not require you to have a lot of knowledge.
It also plays an important role in the scientific method as well.
Trail and error is also an excellent tool for inventors.
Advantages :
STEPS OF BRAINSTORMING :
Encourage Ideas
Clarifying
Evaluate ideas
Solution to the
Original Problem
Evaluate Solutions
Step 1: Start
Step 2: Input N1, N2, N3
Step 3: if (N1>N2) then
if (N1>N3) then
[N1>N2, N1>N3]
else
[N3>N1>N2]
endif
else
if (N2>N3) then
[N2>N1, N2>N3]
else
[N3>N2>N1]
endif
endif
Step 4: Print “The largest number is”, MAX
Step 5 : Stop
`Advantages:
Communication: flowcharts are better way of
communicating the logic of a system to all concerned.
Effective analysis: with the help of flowchart problem
can be analyzed in more effective way.
Proper documentation
Efficient coding
Proper debugging
Efficient program maintenance
Disadvantages:
Complex logic
Alternativess and modifications
Reproductions
Time-consuming
Subjective
Complexity
It is very convenient to classify algorithms based on the relative amount
of time or relative amount of space they require and specify the growth
of time/space requirements as a function of the input size.
TYPES OF COMPLEXITY ARE:
1.SPACE COMPLEXITY
2. TIME COMPLEXITY
2.Time Complexity :
Time complexity of an algorithm signifies the total time required by the
program to run to completion. The time complexity of algorithms is
most commonly expressed using the big O notation.
Time Complexity is most commonly estimated by counting the number
of elementary functions performed by the algorithm. And since the
algorithm's performance may vary with different types of input data,
hence for an algorithm we usually use the worst-case Time
complexity of an algorithm because that is the maximum time taken for
any input size.
Some of the reasons for studying time complexity are:
We may be interested to know in advance that whether an
algorithm/program will provide a satisfactory real time response.
There may be several possible solutions with different time
requirements.
1. Big Omega denotes "more than or the same as" <expression> iterations.