Skip to main content

There are a lot of buzzwords that always resonate in the technical and computing circles, such as: Machine Learning, Data Science, or Algorithms, and the latter is what we will talk about today.

Algorithms are one of the basics of Computer Science that programmers and computer engineers study during their academic or self-learning studies, a term that no specialist or even an ordinary person can overlook.

Algorithms And Their types

In this article, dear reader, we will provide you with everything you need to know about algorithms, starting with their definition, history, types, and how they work. We will provide you with a list of the most important and best international courses that enable you to learn algorithms.

What are Algorithms?

Algorithms are a set of explicit steps that are applied in order to reach a result or solve a problem. Simple definition right?

This definition may seem too simple to you, but on the contrary, it is never like this. This is the definition agreed upon by specialists and academics.

Algorithms And Their types

Algorithms can be simplified or likened to recipes for eating, through which you will transfer the materials you have through a set of steps to the meal that you will eat.

This is the core of defining algorithms, no matter how easy or complex they are, whether they are related to trading or financial markets, or used in hospitals and treatment, or even used to run rockets into space.

For some details on this matter, the algorithms consist of:

The problem or question is described in a mathematical way that a computer can understand. 
A mathematical formula or set of clear steps for dealing with a condition. 
A method of entering problem data to apply the formula or steps to it. 
Execute those steps or formula accurately and smoothly. 
Obtaining the required output from the previously entered inputs or data.

We will talk shortly about how the algorithm works using a simple and easy example that shows us how it works.

In general, algorithms are the magic way that made our lives so easy, as they save a lot of time, effort, and money, and they are more effective and accurate than the human factor and faster by tens and hundreds of times.

History of algorithms

Of course, you would have thought that algorithms and its singular algorithm is a standard Arabic word, or at least close to the Arabic language, and this is true, as Arab scholars were the first to come up with its form that we know now.

The word algorithm or algorithms comes from the name of the Arab scholar Muhammad bin Musa al-Khwarizmi. Who was one of the most brilliant Arab scientists in the field of mathematics, in addition to his contributions to many other sciences, such as astronomy, geography, and others.

Al-Khwarizmi is the father of the science of algebra and he is the founder of it as we know it today, because of which the algorithms were called algorithms because they depend heavily on it in their work.

And you can watch this great short clip on why algorithms are named after this from the BBC:

After this strong Arab beginning, the West translated this knowledge, developed it, and absorbed it into their civilization and later scientific achievements.

For example, in the nineteenth century, Ada Lovelace discovered that algorithms could be applied and implemented by machines, thus opening the door to the algorithms we use today.

And in the twentieth century, the genius scientist Alan Turing applied its concept through the Turing machine, which made the machine actually use an algorithm in the real world, thus opening the door to computing and artificial intelligence as we know it today.

How do algorithms work?

Algorithms And Their types

The way algorithms work is very easy, no matter how different an algorithm is from its counterpart, as it is inputs, on which some calculations or steps are made until the required outputs are obtained.

In order to simplify the way the algorithms work, let’s think about the algorithm through which we choose the clothes we wear, and how we explain to a young child how to choose the clothes that he wears based on them.

In the beginning, the inputs will be the factors that we rely on in choosing these clothes, such as: the temperature in numbers or the summer/winter season, in addition to the occasion and its nature, and the timing at which it will go out.

Through these inputs we will process the clothes we have, and then we will then choose the most suitable clothes we have that we can wear.

In general, there are dozens and hundreds of factors that you can take into account other than that, such as the possibility of rain, the nature of the activity that you will do, the clothes that the people you will meet wear, and so on.

The higher the numbers of these inputs, the more complex the algorithm, and thus the accuracy of its results and the more intelligent and efficient it is in performing its task.

After obtaining all the required inputs, the processing or steps used will come here, which are known in technical algorithms as Computation.

First, you will exclude clothes that are not suitable for this activity or events that you will attend, and then you will exclude clothes that do not suit the current weather or climate.

So after a long process of eliminations depending on your input, you’ll be left with fewer options to dress up with.

You will then have to try to reach the greatest consistency between these clothes in order to have a suitable suit to go out with.

In the end, after you reach this solution, this command will be called Outputs, which is the final output that we wanted to get from the beginning.

This is a simple algorithm, and if we want to talk about smarter algorithms, such as those of machine learning, deep learning, or natural language processing (NLP), we will increase the complexity a bit.

It will feed your algorithm a lot of data and information as input, such as: your past experiences choosing clothes or how you felt about these clothes during the previous times you wore them, and you can also include the experiences of others.

With this large amount of data, the algorithm will be able to be more efficient, and be very smart to choose the best suit to wear.

Types of algorithms

Algorithms And Their types
Algorithms And Their types

There are very many types of algorithms that are used every moment around us, but we can say that there are 7 types that are the most important for algorithms:

1. Recursive Algorithms: Algorithms that call and repeat themselves until the problem is solved and the final result is reached.

Algorithms And Their types

2. Dynamic programming algorithms: These algorithms are somewhat complex, and are used to solve more complex problems, and they are widely used in complex matters, such as studying DNA in biology.

3. Randomized Algorithms: Algorithms that use random results and values.

Algorithms And Their types

4. Backtracking Algorithms: These algorithms solve large and complex problems by experimenting with dividing them and trying to solve them repeatedly until the correct results are reached, so that the problem is solved backwards.

What is Algorithms And Their types?

6. Divide and conquer algorithms: These algorithms first divide the problem or data into smaller parts, then work on solving it and then collect it.

Algorithms And Their types

7. Brute Force Algorithms: This algorithm is one of the simplest algorithms ever, as it performs experiments. For example, if you want to find the 4-digit password of a user, you will try the 9999 possibilities until you reach the correct password.

In general, although there are hundreds and thousands of algorithms that are difficult or impossible for any programmer to learn, there are some algorithms that are used frequently, such as:

Search Algorithms: These algorithms are widely used, involve several algorithms, and are generally used, as their name suggests, to search for a specific value or thing among the data.

It contains a lot of types, such as: Linear Search, Binary Search, Exponential Search, Jump Search, and others.

Sorting Algorithms: Algorithms that are used to arrange or rearrange data and values in lists or arrays, and they are very popular, and they have many types.

Dijkstra algorithm: This algorithm is used to quickly find the shortest path or distance between two points.

Bell Man Ford Algorithm: It is an algorithm used to find the shortest line between two points, especially in graphs with negative weights.

The importance of learning algorithms

In the world of programming and computing, a specialist cannot fail to learn algorithms, as they are the foundation upon which all modern technologies and inventions are based.

Algorithms And Their types
Algorithms And Their types

As you know, the computer only speaks the language of zero and one, but through many steps and complex algorithms, we can make it perform surgery or fly a plane on its own.

Algorithms shorten a lot of time for us, instead of wasting hours and even days on a task, algorithms can do the same task in a few minutes, especially with the development of computers.

It also saves money and effort, by using it we can automate the tasks that we do, and make it take care of the routine things so that we can use this time to deal with creative or more important matters.

Algorithms And Their types

One of the characteristics of algorithms is that they are limited and deterministic. In the end, they solve the problem or reach the required result correctly, otherwise they are not defined as an algorithm, and thus we guarantee their extreme effectiveness.

At this time, algorithms are witnessing a great deal of interest by technical specialists and computer scientists. There are entire disciplines related to the analysis, improvement, and invention of algorithms.

Best courses to learn algorithms

Fortunately, finding a source for learning algorithms is very easy, despite the difficulty and complexity of the topic itself, and this is because there are many people and resources that explain this topic in all languages and methods.

You will find many books, courses, and YouTube lists that explain this important topic.

Among the best courses that I recommend to you are:

1. Introduction to Algorithms course from MIT on YouTube

This course needs no introduction. Like most of the MIT courses in computer science and programming, this course is one of the most popular beginning stations for amateurs to learn algorithms. The course, which dates back to 2011 and contains 47 lectures, has received more than 4 and a half million views.

I also strongly advise you to purchase the reference for the Introduction to Algorithms course to review it while studying this course or even alongside any other course.

2. Intro to Data Structures and Algorithms course provided by Google on the Udacity platform

This free and short course on the Udacity platform has gained a lot of popularity lately, and it is often praised as one of the best starting stations for beginners, especially since it takes only 4 weeks and teaches algorithms using the Python language.

Algorithms And Their types

3. Mastering Data Structures & Algorithms using C and C++ course on Udemy

This course is the most famous and important course for algorithms on the Udemy platform, and its presenter is Abdul Bari, one of the most famous teachers of computer science and programming in the world, and his explanation of algorithms is very famous for being one of the simplest and easiest courses ever.

You can check out a free, slightly abbreviated version of the course’s content, through his Algorithms menu on his YouTube channel.

4. Algorithms Specialization on Coursera

This specialization, consisting of 4 courses on Coursera and provided by Stanford University, is one of the most popular stations for those who want to learn algorithms. It enjoys great fame and respect, and it will take you about 4 months to complete it, at a rate of 4 hours per week.

At the end of the article, it must be emphasized that algorithms have completely changed the shape of our lives, and made us live in this amazing technical progress, and therefore they receive a lot of attention from specialists and computer scientists because of what they can offer us.