next topic    back to Rev 1 index

Topic 4

Principles of algorithm design.


  1. Define the problem:
    Identify what is required for the problem using the IPO model:

  2. Outline the solution:
    After identifying the requirements for the problem, break the problem into smaller tasks and develop an outline of the solution.
    The outline may include:

  3. Develop the outline into an algorithm:
    The outline of the solution developed in step 2 is then expanded into an algorithm.
    Algorithm is a set of steps that need to be followed for solving the problem.
    The algorithm can be developed either in text form (pseudo code) or in a diagram (flowchart)

  4. Test the algorithm for correctness:
    This step is one of the most important in the development of the program.
    This step involves testing the algorithm to ensure it provided the solution for the problem.
    This step also involves identifying any major logic errors with algorithm early on so they can easily be resolved. Check the algorithm for the following:

  5. Code the algorithm into a specific programming language:

    After all design considerations in the previous four steps have been met, the code is written for the algorithm using the chosen programming language.

  6. Run the program on the computer:
    Use a program to execute the code for syntax errors and logic errors.
    If the program has been well designed, the code should solve the problem without any issues.
    If the problem has not been solved, revisit the previous steps:

    This step may need to be repeated several times until the program eventually solves the problem with desired and expected results.

  7. Document and maintain the program:

    With this step, documentation should be an ongoing process from the initial definition of the problem to the final test result of the program.
    Documentation should contain the following information:

    Documentation may be stored as both external documentation (flowchart, pseudo code and user manual) and internal documentation (commenting of the code).
    next topic     back to Rev 1 index