Full Time Web Developer. Part Time Hacker.

When you start learning about data structures and algorithms, things can get complicated really fast. So this article is meant to slow things down and get you comfortable with two common data structures (Queues & Stacks) that are often used as the basic building blocks in more complex algorithm implementations.

**P.S.**

You are already using these data structures in your code, you just don’t know it!

Alright so what is a queue? A more official definition reads something like this:

*“A collection of elements that is maintained in sequence and can be modified by the addition of a new element…*

We are going to review the high level mechanics of a ** Selection Sort Algorithm (SSA) **and then dive into 3 different implementations using JavaScript.

The general idea behind an ** SSA** is to scan through a list of integers, find the smallest element, move it to the front of the list and repeat this process using the next element in the list.

Here is a step-by-step example that highlights how this actually happens:

array --> [4,1,5,2]

index --> 0,1,2,31. Is the element at index 0 [4] > than the element at index 1 [1] 2. Yes. 3. Swap the numbers…

Welcome to my tutorial on the wonderful, mysterious, and magical **Heap Sort Algorithm (HSA)**, which we will build using JavaScript.

I’ll be honest, for any Junior Developers who are not familiar with Binary Search Trees, Max/Min Heaps, and other related concepts, this gonna be a pretty intense walkthrough. My suggestion, take your time with each step and make sure you are solid with the fundamentals as you move through the material. And as Samuel L. Jackson so eloquently put it…

“(Jurassic Park, 1993)Hold on to your butts.”

Ok, first things first, before we can properly define what an *Heap…*

Ok, so I have to admit, I really like this algorithm. It’s not the fastest sorting algorithm, nor is it the most efficient. But I happen to love the fact that **this algorithm doesn’t compare values in a list to produce an ordered result!** That’s right, the counting sort algorithm takes a conceptual *left-turn* and approaches this fundamental problem from different angle. This approach exemplifies the kind of creative thinking that drew to me to programming in the first place.

Before we dig into the specifics I think it’s important to note that this solution and its implementations are strongly…

A guide to iterative and recursive implementations of the Insertion Sort Algorithm with JavaScript.

The ** Insertion Sort Algorithm (ISA) **is another sorting algorithm that sorts a list (or array) of numbers. Unlike

Here is an example using a JavaScript array:

let array = [2,1,4,3];1. Is the number at index 1 [1] < than the number…

A straight forward guide to implementing a ** Bubble Sort Algorithm** in JavaScript.

The ** BSA** is a relatively simple algorithm to understand and implement.

The ** BSA** works by comparing each element in an array to its immediate (adjacent neighbour) to determine which one is greater. The larger of the two elements ends up on the right and the smaller element ends up on the left. …

A simple guide to implementing the ** Quick Sort Algorithm** in JavaScript.

The ** Quick Sort Algorithm (QSA) **is yet another path to sorting elements in a list. In our case, we will be implementing the

The ** QSA **is a kind of

` // Let's choose `**4** as the pivot point** **

**[1,3,4,6,5**]

At this point we partition the…

Let’s find things… fast-ish. This is a thorough look at Binary Search Algorithm implementations in JavaScript (** Iterative and Recursive**). Enjoy.

Building a search function is something that every developer has to do. In fact, basic ** Linear Search functions **are usually some of the first patterns that developers learn to write. If you are unfamiliar with this concept I suggest you get up to speed with the basics of

This algorithm allows you to find out if a…

An overview of recursive and iterative merge sort implementations in JavaScript.

Here we go! So here are 3 implementations of the infamous ** Merge Sort Algorithm** in vanilla JS. When I revisited this algorithm, I was reminded of my first glance at the logic behind it. From a high level, it’s not super difficult to wrap your head around. But as I descended further into the implementations I realized that a precise understanding of the algorithm is actually pretty hard!

Don’t feel bad if you struggle to understand the order of operations or even some of the patterns found in each…

Intimidated? Scared? Don’t be, the basics aren’t nearly as bad as some people make them out to be. In my experience, articles and online guides move a little to fast for Junior Developers to digest and include a lot of assumptions that aren’t as common as some Senior's think.

*So let’s start with the basics.*

**Who is this for? **This article is designed to help Junior Developer’s get a solid grip on Linear Search Algorithms and how to implement in JavaScript. …