Algorithms Are Everywhere

You can make an algorithm out of anything.

Kristina Mancini
3 min readMar 28, 2023
Staircase with the word “problem” at the bottom of the staircase, an arrow pointing diagonal up at the word “steps” in the middle of the staircase, and another arrow pointing diagonally up at the word “solution” at the top of the staircase
Designed by me in Figma

BEEP. BEEP. BEEP.

There goes your alarm again at 7 am. It’s across the room on your wooden dresser. You put it there so that you have to physically get out of bed to shut it off and not press “snooze” every time...unless you still end up going back to bed despite your efforts (I’m guilty of this).

So what’s your process of waking up in the morning? What steps do you take? What are the instructions?

For me, my wake up process starts the night before. Before I go to sleep, the first step is to find my phone. Then, I open the clock app and scroll to which alarm to set up. I turn the volume to the absolute highest and set my phone on my dresser across my room. I go to bed. The next morning my ears hear my obnoxiously loud alarm and…Voila! I am on my feet going to put an end to the blaring noise. It was a process. I had a problem, I completed a set of instructions to help solve it, and got a solution. Almost like…an algorithm perhaps?

Algorithms are like a set of instructions that transform a problem into a solution. Now, It seems crazy to think I can call my process for waking up in the morning an “algorithm”, but algorithms are kind of…everywhere. In your daily life, you might follow a process or a list of steps or instructions to complete something.

From a mundane process such as making a cup of coffee to the functionality of a search engine, algorithms are important because they can be found in everything.

In more computer science-y terms, algorithms help solve computational problems (AKA, involving computers) where the input transforms the output.

Problem — > Steps — > Solution

Input — > Process — > Output

Let’s figure out algorithms in a more computational way. For example:

Problem:

Sort these numbers from smallest to largest: 7, 22, 5, 8, 11, 2.

Steps:

I have to find the first smallest number and find the next smallest number compared to the first smallest number and just keep comparing the next smaller number from before until you reach the end.

I see the smallest number is 2. Then 5. Then 7. Then 8. Then 11. Then 22.

2 < 5 < 7 < 8 < 11 < 22

Solution:

The numbers sorted from smallest to largest are: 2, 5, 7, 8, 11, 22

You could say that the input of this sorting problem is the list of numbers, and the output is the list of numbers sorted from smallest to largest.

Sorting algorithms are kind of a big thing in computer science…and that might explain why there are so many sorting algorithms in the first place. They have a different process for achieving a solution to a problem. Some of these include bubble sort, quick sort, and merge sort just to name a few.

Algorithms are all around us. They are processes, instructions, transformations. Even you. You reading this right now is an algorithm in itself.

And since you have (almost) reached the end of this article, I can successfully tell you that you are about to solve yet another algorithm. What was it exactly? The “problem” was reading the information I’ve written here. As you read through it, you were taking the “steps” to solve the problem. And now, here is the solution.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Kristina Mancini
Kristina Mancini

Written by Kristina Mancini

I write about different topics in computer science and technology.

No responses yet

Write a response