Phases of Algorithm
and
Analysis Process
Algorithm
finite set of instructions that specify a sequence of
operations to be carried out.
 Algorithm design isn’t easy, but it’s not impossible
either. People who design algorithms don’t sit
around looking for problems to solve, they are
usually already involved in projects when a
problem arises that requires a solution.
This might not sound that hard because people
tend to put algorithms in the same class as
functions. However, they are not functions, they are
efficient paths to handling data as accurately and
quickly as the computer allows.
Algorithms resemble recipes. Recipes tell you how
to accomplish a task by performing a number of
steps.
For example, to bake a cake the steps are: preheat
the oven; mix flour, sugar, and eggs thoroughly;
pour into a baking pan; and so forth.
Phases of Algorithm
Every algorithm needs a process in order to be
created and utilized.
Described below are the four stages of
algorithm analysis and design:
Design
 The first stage is to identify the problem and thoroughly understand it.
This is where it’s important you consult with everybody who has an
interest in the problem. Speak with them and see how they see the
problem and what they need out of the solution so their part of the
project or program can progress.
 This is also the point where you are going to flowchart and/or use
pseudo code to work out the specific problems of solving the flow of
operations within the code.
 Analyze
 Once you have the basic framework of the algorithm it’s time to start
analyzing how efficient the code is in solving the problem. Algorithm
design is fluid and subject to individual plans. This is a step that some
programmers like to attack after they have coded the algorithm and run
it through the compiler. Others prefer to examine it prior to writing the
code and analyze results based on their expectations from the design
stage.
 If you are part of a team then have the best programmer in your group
write the initial code, notate it well so the lesser experienced
programmers will understand what is happening as the application is
executed.
 Implement
• Writing and coding the algorithm is the next step in the
process. If you are the one writing the algorithm, then you
need to write it in the coding language you understand
the best. In order for you to know how to write the
algorithm efficiently you have to know exactly what each
line of code is going to accomplish when the program is
executed. Write the code to execute quickly but can also
handle the input data that it will receive.
• If you are part of a team then have the best programmer
in your group write the initial code, notate it well so the
lesser experienced programmers will understand what is
happening as the application is executed.
 Experiment
 Once the algorithm is designed and coded go back and
experiment with different variables in the algorithm. Try
and enter data that will make it fail or try and re-write the
code to work it out most efficiently. Experimentation in
algorithmic design is really just another step of the
analyzing of the algorithm.
 When you find flaws in what you have written or ways to
write the code better, then go back to the design step and
redesign the algorithm.
Examples:
• Let's say that you have a friend arriving at the airport, and your friend
needs to get from the airport to your house. Here are three different
algorithms that you might give your friend for getting to your home:
 The taxi algorithm:
• 1. Go to the taxi stand.
• 2. Get in a taxi.
• 3. Give the driver my address.
 The call-me algorithm:
• 1. When your plane arrives, call my cell phone.
• 2. Meet me outside baggage claim.
 The rent-a-car algorithm:
• 1. Take the shuttle to the rental car place.
• 2. Rent a car.
• 3. Follow the directions to get to my house
 Write an algorithm to add two numbers entered
by user.
Step 1: Start
Step 2: Declare variables num1, num2 and sum.
Step 3: Read values num1 and num2.
Step 4: Add num1 and num2 and assign the result to
sum.
sum←num1+num2
Step 5: Display sum
Step 6: Stop
Analysis of Algorithms
"Analysis of algorithms is the theoretical study of
computer program performance and resource usage".
How good is the Algorithm?
 correctness
 time efficiency
 space efficiency
 security
 functionality
 robustness
 user-friendliness
Quiz:
1-4 .What are the phases of Algorithm design.
5. Analysis of algorithms is the
of computer program
performance and resource usage.
6-8. Give 3 examples of characteristic of
Analysis of Algorithm.
9-10. Write algorithms that is used in real life
and in Programming.
End

phases of algorithm

  • 1.
  • 2.
    Algorithm finite set ofinstructions that specify a sequence of operations to be carried out.  Algorithm design isn’t easy, but it’s not impossible either. People who design algorithms don’t sit around looking for problems to solve, they are usually already involved in projects when a problem arises that requires a solution.
  • 3.
    This might notsound that hard because people tend to put algorithms in the same class as functions. However, they are not functions, they are efficient paths to handling data as accurately and quickly as the computer allows. Algorithms resemble recipes. Recipes tell you how to accomplish a task by performing a number of steps. For example, to bake a cake the steps are: preheat the oven; mix flour, sugar, and eggs thoroughly; pour into a baking pan; and so forth.
  • 4.
    Phases of Algorithm Everyalgorithm needs a process in order to be created and utilized.
  • 5.
    Described below arethe four stages of algorithm analysis and design: Design  The first stage is to identify the problem and thoroughly understand it. This is where it’s important you consult with everybody who has an interest in the problem. Speak with them and see how they see the problem and what they need out of the solution so their part of the project or program can progress.  This is also the point where you are going to flowchart and/or use pseudo code to work out the specific problems of solving the flow of operations within the code.
  • 6.
     Analyze  Onceyou have the basic framework of the algorithm it’s time to start analyzing how efficient the code is in solving the problem. Algorithm design is fluid and subject to individual plans. This is a step that some programmers like to attack after they have coded the algorithm and run it through the compiler. Others prefer to examine it prior to writing the code and analyze results based on their expectations from the design stage.  If you are part of a team then have the best programmer in your group write the initial code, notate it well so the lesser experienced programmers will understand what is happening as the application is executed.
  • 7.
     Implement • Writingand coding the algorithm is the next step in the process. If you are the one writing the algorithm, then you need to write it in the coding language you understand the best. In order for you to know how to write the algorithm efficiently you have to know exactly what each line of code is going to accomplish when the program is executed. Write the code to execute quickly but can also handle the input data that it will receive. • If you are part of a team then have the best programmer in your group write the initial code, notate it well so the lesser experienced programmers will understand what is happening as the application is executed.
  • 8.
     Experiment  Oncethe algorithm is designed and coded go back and experiment with different variables in the algorithm. Try and enter data that will make it fail or try and re-write the code to work it out most efficiently. Experimentation in algorithmic design is really just another step of the analyzing of the algorithm.  When you find flaws in what you have written or ways to write the code better, then go back to the design step and redesign the algorithm.
  • 9.
  • 10.
    • Let's saythat you have a friend arriving at the airport, and your friend needs to get from the airport to your house. Here are three different algorithms that you might give your friend for getting to your home:  The taxi algorithm: • 1. Go to the taxi stand. • 2. Get in a taxi. • 3. Give the driver my address.  The call-me algorithm: • 1. When your plane arrives, call my cell phone. • 2. Meet me outside baggage claim.  The rent-a-car algorithm: • 1. Take the shuttle to the rental car place. • 2. Rent a car. • 3. Follow the directions to get to my house
  • 11.
     Write analgorithm to add two numbers entered by user. Step 1: Start Step 2: Declare variables num1, num2 and sum. Step 3: Read values num1 and num2. Step 4: Add num1 and num2 and assign the result to sum. sum←num1+num2 Step 5: Display sum Step 6: Stop
  • 12.
    Analysis of Algorithms "Analysisof algorithms is the theoretical study of computer program performance and resource usage". How good is the Algorithm?  correctness  time efficiency  space efficiency  security  functionality  robustness  user-friendliness
  • 14.
    Quiz: 1-4 .What arethe phases of Algorithm design. 5. Analysis of algorithms is the of computer program performance and resource usage. 6-8. Give 3 examples of characteristic of Analysis of Algorithm. 9-10. Write algorithms that is used in real life and in Programming.
  • 15.