Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
26 views

9 - Algorithm Design and Problem Solving

Uploaded by

Aayan Ahmad
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views

9 - Algorithm Design and Problem Solving

Uploaded by

Aayan Ahmad
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Algorithm and Problem Solving

Abstraction is the process of selecting the relevant data and removing the irrelevant data to solve a
problem.
For example, in the making of a road map, abstraction is used in order to specify only that information
which is required to travel from one place to another. The information may include the enroute towns,
traffic situation but may not include information about the terrain since that would be unnecessary.
Stages of Abstraction:
1. Identify the purpose of the model to be formed by abstraction.
2. Identify the sources who would provide information for the model. This includes interviewers,
observations etc.
3. Identify what information to use from the gathered information.
Benefits of Abstraction:
1. Less time taken to write a program.
2. Less storage space is required.
3. Greater customer satisfaction.
Decomposition is the process of breaking a complex problem into smaller parts which can again be sub
divided into smaller parts, making it easier to examine and understand the problem.
Pattern Recognition is the process of identifying those parts of the code that are similar and could use the
same solution. This leads to the formation of functions, subroutines and procedures.
For example, if a person wants to add 2 numbers, he can write the code to add the 2 numbers once, store it
as a function and whenever he wants to add 2 numbers, he can simply call the function again and again,
without having to rewrite the whole code of adding 2 numbers again.
Benefits of Pattern Recognition:
1. It helps save time.
2. It allows for modular programming.
3. The sub routines, functions and procedures are pre tested so less errors are present.
Algorithm is a step-by-step solution to a problem.
For example, starting a car.
1. First put the key in.
2. Rotate the key at ON position.
3. Twist the key and hear the starter go on.
4. Then leave the key once the car has started.
Types of Algorithms:
1. Sequence- All instructions are carried out in an order. E.g.; setting an alarm clock.
2. Selection- Options are given to the user to choose from.
3. Repetition- Certain selections are carried out for a fixed number of iterations or when a condition
becomes True/False, such as in loops.
Methods of Representing an Algorithm:

1
Algorithm and Problem Solving
1. Structured English: Method of showing steps using English words to give commands to the
computer.
2. Flowchart: Method of showing steps diagrammatically using a set of symbols which are linked
together via flowlines.
3. Pseudocode: Method of showing steps in detail using keywords, variables assigned with names
and mathematical operators.
Flowchart Symbols:

Symbols Details
Start/ Stop

Process

Input/ Output

Decision

Built in Function

Flow lines

You might also like