# Creational Design Patterns

Creational design patterns focus on abstracting the instantiation process. They aid in making a system independent of how its objects are created, composed, and represented. Creational design patterns can be categorized into two groups, class creational patterns, which use inheritance, and object creational patterns, which delegate instantiation to another object…

# Javascript Algorithms — Counting Sort

In this post, we’ll be introduced to our first non-comparison sorting algorithm — counting sort! By being a non-comparison algorithm, counting sort doesn’t really care about what the other elements in a list are when it’s figuring out the sorted position of any given element, and you’ll see why when…

# Javascript Algorithms — Binary Search

In this post, we’re going to be discussing a search algorithm known as binary search. Binary search, like merge sort, is based on the divide and conquer principal. It’s a very simple concept, but can prove tricky during implementation. Binary search runs in logarithmic time, O(log n), making it a…

# Javascript Algorithms — Merge Sort

In this post of the Javascript Algorithms series, we’re going to talk about merge sort. Merge sort is another comparison sorting algorithm that runs in linearithmic, or O(n log n), time. While the run time of merge sort is similar to that of quicksort, quicksort is typically preferred in practice…

# Javascript Algorithms — Selection Sort

The next algorithm we’ll discuss in this series is selection sort. Selection sort is a very simple, comparison algorithm that runs in O(n²) time. This algorithm is very simple and easy to implement, however it is also very inefficient (though not more so than bubble sort!).

The idea behind selection…

# Javascript Algorithms — Quicksort

In this next post in the Javascript Algorithms series, we’re going to discuss quicksort. Quicksort is a comparison algorithm that, on average, runs in O(n log n), or linearithmic, time. Quicksort is often compared to the merge sort algorithm. Both algorithms run in a linearithmic time on average, but merge…

# Javascript Algorithms — Bubble Sort

The next algorithm in the Javascript Algorithms series is bubble sort. Like insertion sort, bubble sort is a comparison algorithm and runs in O(n²) time, making it an inefficient algorithm for larger lists. As we saw in the last post about insertion sort, often times in practice quadratic sorting algorithms…

# Javascript Algorithms — Insertion Sort

In the first post of the Javascript Algorithms series, I will focus on insertion sort. Insertion sort is a very simple comparison sort used for sorting an array (or list). A comparison sort is any sorting algorithm that compares the current value that you are trying to place with other…