Learning Algorithms: The Beginning

Jacob Hampton
4 min readFeb 26, 2021
Photo by Karla Hernandez on Unsplash

I love books, particularly paperback books, from the feel in my hands to the smell, and everything else. The only thing I don’t love about books is moving them.

I didn’t always love reading but eventually, I needed a reason to justify the books I was buying so I started reading them and was pleasantly surprised to find the content often as enjoyable as the aesthetics. One recent addition to the book collection (as I’ve started my path to becoming a software engineer) is about algorithms. This fact brings us here, to this blog and series (and hopefully help).

It didn’t take long to realize there is more than one blog’s worth of information to learn and share about algorithms so I’m hoping to share the learning journey with you through this series. As a minimum benchmark, I’ll attempt to work through and explain areas such as graphs, searching, and sorting algorithms in a broad sense. I’m also aiming to maintain enough flexibility to include deeper dives on specific topics like Big-O Notation, Breadth-First Search (BFS) vs. Depth-First Search (DFS), and maybe some famous algorithms as we go through the series.

To start let’s look at the very basics of what an algorithm is and how your life is already affected by them.

Photo by Viswanath V Pai on Unsplash

Algorithms are a series of steps (or instructions) to follow to accomplish a task. Two (though there are certainly more) important measures when talking about algorithms are correctness (consistently achieving the correct outcome) and efficiency (basically, how many steps does the worst-case scenario take).

With this beginning understanding of what an algorithm is, let’s take a look at some of the ways you already use algorithms, how you can intentionally use them in other areas, and how algorithms have impacted the world.

Mind exercise: think about your favorite part of the morning (something you do almost every day).

The first thing that comes to my mind is making a cup of coffee. For me, making a cup of coffee is getting 12 fl. oz. of water, placing the water in the “water holding area” (who learns technical names before they’ve had coffee?), placing 2 tablespoons of ground coffee beans into my filter, quickly tamping (this is the technical name) my coffee grinds, double-checking I’m not missing water or coffee grinds or a mug, and then pressing the “brew now” button. Those are the same steps I take every morning to produce a consistent cup of coffee.

Mind exercise part 2: try walking through every part of your favorite routine. Do you have consistent steps you take? If so, congratulations. You’ve already created an algorithm and are using it!

Making a cup of coffee or whatever routine you chose is great but will understanding and thinking about things like an algorithm help with bigger challenges? Should you care? Yes. If we abstract our morning routine, we realize that, while it’s on a small scale, it’s ultimately taking the input(s) we have (coffee grinds, water, coffee machine, etc.) and taking steps to get to the desired outcome (a cup of coffee). This kind of thinking can also allow us to break down a big goal into little goals and then act on those little goals until we’ve accomplished what once seemed too big or too complicated. Next time you have a goal that seems too complicated to solve, break it down into little pieces and then follow the steps.

“early humanity’s ability to consistently build and use fires is thanks to an algorithm”

Tying into whether algorithms can help us accomplish big things, let’s look at some major impacts of algorithms. If we go way back to one of the most impactful human innovations, early humanity’s ability to consistently build and use fires is thanks to an algorithm — having repeatable steps that produced a consistent, desired outcome. If we think about books, the printing press operated on an algorithm allowing for the mass production of books so knowledge and learning could become more accessible than ever before. In a modern context, whether you’re using your phone, laptop, etc. to read this, you’re using algorithms almost anytime you interact with a computer. Software is generally responsible for your experience with the digital world and the backbone of most software is made up of algorithms. The modern world we all live in is constantly influenced and impacted by the algorithms which get us information, connect us to friends and family around the world, stream our movies, and let us shop from anywhere.

Here’s to the upcoming exploration of the marvel we call algorithms and hopefully how we can continue changing our worlds and the world around us for the better with them.

--

--