DEV Community

Ifeoluwa Adewunmi
Ifeoluwa Adewunmi

Posted on • Edited on

What Is An Algorithm (Algorithm explained for absolute beginners)

You may have heard the word algorithm, whether from your techie friends, on YouTube or anywhere else but it sounds so ambiguous for you to grasp. In this guide, I will explain to you what an algorithm is in the Real World, Mathematics, and Computer Science World. Without further ado, let’s dive into it.

This guide attempts to demystify an algorithm by explaining the following:

  • Algorithm in Real World
  • Algorithm in Mathematics
  • Algorithm in Computer Science

WHAT IS AN ALGORITHM IN THE REAL WORLD

Algorithms are everywhere and present in our daily activities. Although they have a more significant presence in math and computer science, they exist in other places, too.

For instance, on a faithful Sunday afternoon, I asked my friend KIKI a 5-star baker and a tutor, to teach me how to bake a chocolate cake. She disagreed initially, but after teasing her with sweet words, she picked up a book and a pen to list out the ingredients needed and the procedures to use the listed ingredients efficiently so that I wouldn’t end up baking a burnt offering instead of a chocolate cake. This list and steps written by KIKI can also be said to be a recipe.

A recipe is like an algorithm in that it’s some steps (written on a box or included in a book) that achieve a specific task. In the scenario I was making earlier, the specific task is to bake a chocolate cake. To achieve that, I need to follow the steps written (algorithm) by my friend KIKI. Do you get a general idea already?

WHAT IS AN ALGORITHM IN MATHEMATICS

An algorithm in mathematics is a procedure or a description of a set of steps used to solve a mathematical computation. Algorithms are used in many STEM fields, but the most common example is a step-by-step procedure used in long divisions.

The process of solving a mathematical problem such as, “What is 73 divided by 3” could be achieved by doing the following algorithm:

  • How many times does 3 go into 7?
  • The answer is 2
  • How many are left over? 1
  • Put the 1(ten) in front of the 3.
  • How many times does 3 go into 13?
  • The answer is 4, with a remainder of one.
  • And of course, the answer is 24 with a remainder of 1

An algorithm in math is not that different from an algorithm in computer science or app development. Both have the same definition, description, and significance.

Wait, before explaining what an algorithm in computer science is to you, could you, give this article a like and kindly hit the follow button, please?

WHAT IS AN ALGORITHM IN COMPUTER SCIENCE

In Computer Science, an algorithm is when you tell your computer what to do and also give it precise instructions on how to do it.

Let us illustrate a search example similar to what you do on google search:

  • You type in keywords
  • Clicks the search button in expectation of results.
  • The computer takes in your search request.
  • Uses a search algorithm implemented to process the given keywords against the database or data warehouse
  • Then returns information on your searched keywords.

In computer science, there are various types of search algorithms available and the way they are used decides the performance and efficiency of the data available.

Explaining types of search algorithms is beyond the scope of this guide, however, you can read my guide on:

  • Google Search Algorithm
  • Types of Search Algorithms

Having read through my explanation of an Algorithm above, you will find out that Algorithm is having more precise and descriptive instructions for achieving any given task. I believe that you now have a clearer understanding of what an algorithm is. Please, do not forget to like, comment and share. Thank you for reading through, see you in the next one.

Top comments (4)

Collapse
 
chiragagg5k profile image
Chirag Aggarwal

Amazing explaination. I feel like there are a lot of terms in computer science , for eg. "Algorithm", which sound very complex or techy. But when you actually learn their meanings , they are not that complex at all.

Collapse
 
ife_adewunmi profile image
Ifeoluwa Adewunmi

Thank you, and yes, I agree with you, when the actual meaning of some terms in computer science is communicated in a layman's language, it wouldn’t be challenging to comprehend.

Collapse
 
boluwatife_be profile image
Emmanuel

Very explanatory, thank you very much.

Collapse
 
ife_adewunmi profile image
Ifeoluwa Adewunmi • Edited

Thank you for your kind words, I am glad you found it helpful