One of the most helpful problem solving patterns in computer science is known as the frequency counter pattern. Commonly used on arrays and strings, it is named frequency counter because when we use it, we create an object or set to store the elements in our string or array, along with how many times they occur in that string or array. More specifically, the element is usually a key in the object, and the value for that key is how many times that element is found.

When should this pattern be used?

Frequency counters are most frequently(pun intended) used to compare data in some way. Some…


Studying data structures, algorithms, and practicing interview questions are essential parts of preparing to land your first job as a software engineer. Throughout my job search so far, I have been putting time into these endeavors but have definitely spend more of my time working on projects. I much prefer building sites and applications to doing interview questions, and it is essential to growing as a developer. At the same time, practice problems also help sharpen my skills and will make me better at working on my projects, just not as directly. …


Hash tables are one of the most commonly used data structures in programming. While I consider myself to be extremely comfortable with using them in code that I write every day, up until this week I had never taken the time to consider how they actually work. In this article, I will be giving a brief overview of what hash tables are, hash functions, how to handle collisions, and the big O of hash tables. Many of the screenshots in this post are from this replit page that I made, where I constructed a hash table from scratch.

Overview

Hash tables…


Last week, I wrote about my first foray into Binary Heaps, which can be found here. Having knowledge of heaps is really helpful when learning priority queues, since the optimal(but not only) way to implement them is with a heap. In last weeks post, I also had a link to a repl I made showing how to construct a max heap in JavaScript(here), as well as some essential methods to implement. I have added a priority queue class in that same repl.

What are priority queues?

A priority queue is an abstract data structure. It is a lot like a normal queue, except each…


A heap of trash
A heap of trash

Up until this week, the only heaps I was familiar with were the heaps of trash that are a mainstay of NYC streets. Thankfully this week of studying data structures has shown me that not all heaps are hot garbage. In this article, I will be reviewing what I have learned so far about binary heaps as well as how to construct and interact with them. A lot of the images in this article are from my repl, where I constructed a Max Binary Heap and wrote a few class methods to make it functional. I also have some notes…


Another week into studying data structures and algorithms, I am learning about tree traversal. Last week, I wrote a blog about my introduction to binary search trees, which can be found here. That article is an overview of what trees are, and how to construct them with JavaScript classes. This article will expand that same class, which can be found here, to include some of the more common algorithms for tree traversal.

Tree traversal is a classic computer science problem. The idea is to visit every single node in the tree once, regardless of the shape or specific type of…


A binary tree in the wild

Learning about data structures beyond the ones that are built into JavaScript(like arrays and object literals) has been a blast. Aside from being essential knowledge for a developer to possess, I am really enjoying creating the custom classes for each data structure along with the methods that make them work. Trees, specifically Binary Search Trees(BST) are the most interesting ones that I have learned so far, and I’m excited to share the knowledge that I have gleaned. In this article, I will be delving into what a tree is, some of the real-world applications of trees, and the big O…


Stacks and Queues are very simple, efficient and useful data structures. Sounds great, so why not just use them for everything? The reason is that they do a couple of things very well, but not much else. That being said, it is important to know how they work and when to use them, since they are very lightweight and efficient in the right situation. Today I will delve into each of them, and discuss what they are, some analogies from outside of CS, their real-world applications in programming, and the big O of some operations. Several of the images in…


Meme depicting developers mocking someone that still uses jQuery
Meme depicting developers mocking someone that still uses jQuery

A lot of people will tell you that jQuery is dead because JavaScript frameworks like React, Angular, Vue, and Ember are far more in favor right now. Those frameworks may be in style right now, but based on my research, jQuery is still used in some form or another on roughly 75% of all websites. I do not have hard data for these numbers, but various sources I have found all put the number somewhere around 75% of all sites, and 95% of sites that use JavaScript. …


One does not learn data structures without implementing a linked list and a binary tree from scratch
One does not learn data structures without implementing a linked list and a binary tree from scratch

I will admit that when I first started learning data structures and algorithms, I was terrified. After studying them for a little while, I’m really enjoying them. My impression is that most people who love programming would enjoy studying DS if they haven’t already. For me, the negativity was tied to a fear of having to know every data structure and sorting algorithm for job interviews. Once I actually started learning, it was easy to forget about the pressure of job interviews and just enjoy coding.

Since I know it can seem overwhelming at first, I am writing this article…

Liam Hanafee-Areces

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store