Plurrrr

a tumblelog
Wed 02 Sep 2020

On Modern Hardware the Min-Max Heap beats a Binary Heap

The heap is a data structure that I use all the time and that others somehow use rarely. (I once had a coworker tell me that he knew some code was mine because it used a heap) Recently I was writing code that could really benefit from using a heap (as most code can) but I needed to be able to pop items from both ends. So I read up on double-ended priority queues and how to implement them. These are rare, but the most common implementation is the “Interval Heap” that can be explained quickly, has clean code and is only slightly slower than a binary heap. But there is an alternative called the “Min-Max Heap” that doesn’t have pretty code, but it has shorter dependency chains, which is important on modern hardware. As a result it often ends up faster than a binary heap, even though it allows you to pop from both ends. Which means there might be no reason to ever use a binary heap again.

Source: On Modern Hardware the Min-Max Heap beats a Binary Heap, an article by Malte Skarupke.

10 lesser-known Web APIs you may want to use

In this article, I am going to talk about 10 more web APIs that are not so popular. Lesser popular doesn't mean, they are not useful. You can use them in various use-cases of your project. Please have a look.

Source: 10 lesser-known Web APIs you may want to use, an article by Tapas Adhikary.

Firefox Tricks - Using alternate stylesheets

There are many underutilized features in browsers these days but there is one that had been present in Firefox for a long time and is apparently completely unknown to most web developers, they are called page styles and they expose alternative style sheets to the user.

Source: Firefox Tricks - Using alternate stylesheets, an article by Andre Alves Garzia.