The Art of Writing Algorithms in Human Language

Preface:

Human Language means the language that is understandable by Humans and readable by Humans. The language probably means ‘ENGLISH’ Because about 90% user traffic and data on the internet is written in English in some form. Even when we use translation Software the translation happens in the mentioned way:

First Converted User Query — Then it is translated in English for the Machine — Then output is given

Even the machine needs to understand user query in English. Because in CS English and Mathematics are the Universal Language. It breaks our barrier.

The article tells how Algorithms is written in Human readable language.

Main:

Algorithms are written using two ways. These are:

  1. Only Mathematics/English
  2. Pseudo Way (Mixtures of English and Mathematics)

These ways are not to be written for the Computer rather only for the Human to understand ‘What the algorithm will do?’ So, these are the ways Algorithms are written in the paper not in the machines.

Method 1.

The first method from the list used when we want to first understand what the Algorithm should do. It means we are in the first step of writing an Algorithm. We are still thinking and coming up with a solution. Of course, Algorithms are math formulas created by CS Academics.

First Step is to write English version of Algorithm. Then move to Mathematical version for better understanding and coming to the path of Pseudo Code.

One such example is shown below:

Method 2.

Pseudo Code is the language of stupidity and personal. But there are some rules:

  1. It will contain both English and Mathematics
  2. It will contain Code as well as the above
  3. There is only possible madness
  4. There is no rule.

This is one of the examples of Pseudo Code:

Conclusion:

This is the way ‘How Algorithms is written by CS Academics!’ The general writing style and even the Academic way is also the above. The only thing that will change is the complexity of the Algorithms. So, the algorithms will be created by some special students not all.

That’s it!

Join our Space (Algorithms for Creatives)