Algorithms are everywhere!
So, what are algorithms?
They are a step by step process for getting a task done.
Algorithms basically help us solve problems, the more algorithms we know, the more problems we’re able to solve.
What kind of problems do algorithms help us solve? Everything from finding information to connecting us to friends and family, from helping us navigate through traffic to detecting diseases and the list goes on…
Let’s take Facebook for example, as of 2020, Facebook has 2.45 billion users, imagine how many people are trying to access Facebook on a regular basis…all at the same time? A LOT.
Algorithms allow Facebook to run smoothly.
When users go on Facebook to log in, here’s what happens:
Facebook has to confirm that you have an account with them, the only way for it to do this is to search for your username in their database. How do they handle this search problem? With the binary search algorithm.
With binary search, the input (whatever the person types in as their username) is considered a sorted list of elements.
So, when Facebook goes to look for that particular username, if the element it’s looking for in the database is in that sorted list, it’ll return the position where it’s located. If the element (part of the username) isn’t in the database, it returns “null” which means invalid.
This entire process enables Facebook to search for users at an incredible speed. If Facebook didn’t use the binary search algorithm, the site would be a nightmare.
So, we see how algorithms become extremely important in web development when you start dealing with large amounts of data.
Now, you may be wondering, how can an algorithm help when it comes to diseases?
Let’s consider kids in certain parts of the world where clean drinking water and food is in short supply. In these types of countries, children suffer from “environmental enteric dysfunction”, which is a disease that causes the gut to have a difficult time absorbing critical nutrients, this can cause all sorts of issues in their brain development and in some cases can even cause death. This is all preventable with algorithms.
How? Well, by incorporating machine learning algorithms to the diagnostic process we can aid health professionals attempting to deal and fight this disease.
We can train computers to read a ton of biopsy images allowing pathologists to screen patients more productively and in return causing the time between imaging and diagnosis to be significantly reduced.
Algorithms could potentially save millions of lives.
There are plenty of approaches we can take when solving problems, which means there are a ton of algorithms to choose from, it’s up to us to decide which approach makes the most sense for our given situation.
Very rarely, you may need to design your own algorithm because sometimes problems can’t be solved with the algorithms that already exist but again, this is rare.
Here are the top 10 most practical algorithms:
- Binary Search
- Selection Sort
- Quick Sort
- Merge Sort
- Breadth-first Search
- Topological Sort
- Dijkstra Algorithm
- Approximation Algorithms
- Greedy Algorithms
- K-nearest Neighbors
I’ve shared a minuscule amount of information in regards to algorithms but I hope it has inspired you to look into the numerous ways which you can solve problems.
As software developers, we’re always going to run into problems, the essence of what we do revolves around solving problems in the most systematic way…this is where algorithms come into play. They not only have the power to transform the way you go about doing your job but they can also transform the world.
“The more I learn, the more I realize how much I don’t know.” — Albert Einstein
What kind of problems will you solve?