TypeScript Binary Heap

Yesterday I converted a Binary Heap data structure in TypeScript. The original code is here, in the Eloquent JavaScript online book by Marijn Haverbeke.

In short, a Binary Heap is a common data structure for a priority queue. We want to put inside the queue many values (or an object) and you want to extract the smallest value (or the object with the smallest score) in the most efficient way.

This JS implementation the Eloquent Javascript book is pretty common, so I decided “to typify it”.  The result is in the following Gist:

Header Image
Quick Dev Tips: Pixel-Perfect Scaling of a Phaser game

As you may know, I am in the middle of developing a demo for some Smart Pathfinding, and I’m using Phaser and TypeScript for it. Unfortunately, as soon as I started coding a couple of days ago, …

Read
Header Image
Basic Bootstrap for Phaser.io and Typescript Game Development

In the last period, I’m really enjoying TypeScript. It is typed, can be used in a functional way without effort, it like a C# for the Web, in short, I love it. For this reason, I started …

Read
Header Image
The most promising languages of 2016

It is time to update one othe most popular article in this blog. It is time to talk about the most promising languages of 2016! But first, let me repeat the small notice I did the last year. The …

Read
comments powered by Disqus