Algorithm Components and Algorithm Expression Patterns

Subjects:

Erdeniz Tunç
3 min readApr 8, 2023
  • What Should be in the Algorithm
  • Algorithm Expression Patterns

What Should be in the Algorithm

  1. Clarity
  2. Input
  3. Output
  4. Accuracy
  5. Efficiency
  6. Configuration
  7. Processing Time
  8. Memory Usage
  9. Splitting into subproblems
  10. Reusability

Let’s examine these items now.

  1. Clarity: The algorithm should state the steps to be performed step by step in a clear and understandable way.
  2. Input: The algorithm must specify what type of data to use as input and how to get that data.
  3. Output: The algorithm must specify what kind of output will be obtained as a result of the operation and how this output will be presented.
  4. Accuracy: The algorithm must fully and accurately describe the operations required to produce the correct results.
  5. Efficiency: The working of the algorithm should be designed to solve the given problem as soon as possible.
  6. Configuration: The algorithm should have a structure that follows step-by-step processes from a starting point.
  7. Processing time: The algorithm must specify how much time is needed to process the given inputs.
  8. Memory usage: The algorithm must specify how much memory the data will use and whether this memory usage is sufficient.
  9. Splitting into subproblems: The algorithm should make large problems easier to solve by dividing them into smaller subproblems.
  10. Reusability: The algorithm should be reusable for similar problems.

Routinely Going to School Algorithm:

  • Start
  • Wake up
  • Take a shower
  • Get ready
  • Have breakfast
  • Get out
  • Wait for the bus
  • Get on the bus
  • Get off the bus when you arrive in front of the school
  • Enter to school
  • End

Algorithm Expression Patterns

1. Writing the algorithm as text
2. Pseudo Code
3. Algorithm Flowcharts

Writing the Algorithm as Text

The problem to be solved is written step by step as text and each line is numbered. It starts with “Start” and ends with “End”.

1- Start
2- Enter the number (A)
3- Calculate the square of the number (Square = AA)*
4- Write the result (square)
5- End

Pseudo Code:

This is a Algorithm is a form of expression that is similar to everyday speech but far from the details of any programming language.

Here is a pseudo code that states the state of water at a given temperature:
1- Write a program description message
2- Write a warning message for the user to enter the temperature
3- Read the entered temperature
4- If the temperature is 0 degrees Status = “Ice”
5- If temperature > = 100 Status = “Steam”
6- If not status = “Water”
7- Write the result

Algorithm Flowcharts:

The steps are written in specific symbols and the relationships and direction between the steps are indicated by arrows.

The shapes have various meanings as you can see in the image below.

“Is the Lamb Working??” Algorithm

Summary

  • 10 important items that should be in the algorithm are listed. These features that should be in the algorithm; Clarity, Input, Output, Accuracy, Efficiency, Configuration, Processing Time, Memory Usage, Splitting into subproblems, Reusability.
  • Examples of writing as text, pseudo code and flowcharts are also given as algorithm expression forms.

--

--

Erdeniz Tunç
Erdeniz Tunç

Written by Erdeniz Tunç

I share my notes. Especially in Product Management

No responses yet