admin@honeycatcher0x04.art

email contact

NOTE: You should not use the above for legitimate contacts. This is a spam honeypot. All messages sent to that domain are assumed malicious/spam.

CS Review: Merge Sort

Merge sort is among the divide and conquer algorithms. That is to say, it divides the input array into half, calls itself on both halves. This process is done recursively over the entire array. When we’re done, all the individually sorted pieces are merged back together to form the fully sorted array. A Closer Look at the Functionality Merge sort can be a bit hard to wrap your head around when you first hear it, so let’s take a look at how the process looks on an example array....

February 28, 2021 · 4 min · Adam Thompson

CS Review: Quicksort

Quicksort is another one of the divide and conquer sorting algorithms. It works by partitioning the array around some chosen pivot point, which there are a few different ways to choose. Quicksort is generally preferred over merge sort for sorting arrays due to the fact that the general form of the algorithm sorts in-place. How Quicksort Works As has already been mentioned, quicksort partitions your array of data based on some pivot point....

February 28, 2021 · 4 min · Adam Thompson

CS Review: Bubble Sort

Bubble sort is the easiest possible sorting algorithm you could imagine. It works by simply iterating over an array of data and comparing adjacent items. If those items are in the wrong order, then they are swapped. In doing this, the largest items “bubble up” to the correct position in the array (assuming ascending order, anyway). While this is great from a simplicity standpoint, it’s a pretty awful solution in terms of efficiency....

February 27, 2021 · 2 min · Adam Thompson

CS Review: Selection Sort

The previous sorting algorithm we took a look at was bubble sort. This time around we will be taking a look at selection sort, which is slightly more complex than bubble sort, but only by a tiny bit. The idea behind selection sort is that you keep iterating over your array of data, finding the minimum element each time and placing it at the start of the list. In this way, you can think of selection sort as managing two subarrays: the portion of the array that is sorted and the portion that still needs to be sorted....

February 27, 2021 · 2 min · Adam Thompson

The Dining Philosophers Problem

The dining philosophers problem is a classic problem in the realm of computer science. If you’ve had any formal CS education you’ve more than likely seen the problem when learning about concurrent programming. Today we will take a look at the problem and look at an example of how we can solve it. The Problem Suppose you had a round table with five silent philosophers sat around the table. Between each pair of adjacent philosophers is a chopstick (so, 5 total chopsticks) and there is a bowl of rice in the center of the table....

August 21, 2020 · 7 min · Adam Thompson

Quickly Generating Primes Below n with the Sieve of Eratosthenes

The uses for prime numbers in computer science are nearly endless. They are useful for everything from hashing, cryptology, factorization, and all sorts of applications in-between. There exists a great number of algorithms that allow us to quickly generate primes, but today we are going to take a look at a popular method known as a prime sieve. There are a number of different implementations of prime sieves, but one of the simplest to implement is known as the Sieve of Eratosthenes....

May 17, 2017 · 3 min · Adam Thompson