Sep 2, 2015
This is part 2 of a series of posts going into different array sorting algorithms. I will be looking at radix sort in this one. Check out my pal Marq’s blog for other sorting algorithms. Here is part 1 of my blog if you missed it.
Read More
Aug 9, 2015
Skip lists are interesting data structures that rely on a random element in its design. The resulting data structure allows O(log(n)) time complexity for search, insert, and delete operations with high probability. Here is a walkthrough of a skip list implementation, also available on my Github repo.
Read More
Aug 8, 2015
This is part 1 of a series of posts going into different array sorting algorithms. I will be looking at mergesort in this one. Check out Marq’s blog for other sorting algorithms, as we’ll be looking at different ones during this “sprint”.
Mergesort is a divide-and-conquer array sorting algorithm that can be implemented in several ways. Conceptually, the algorithm goes like this:
- Split the list of n elements into n sublists with 1 element each
- Repeatedly merge sublists into sorted lists until only 1 list remains
Read More
Aug 2, 2015
How to implement MongoClient connection pooling in a simple Node.js/MongoDB web app.
Read More
Jul 28, 2015
The slow-by-design processing time is a strength of the bcrypt hashing algorithm, but it also means that it needs to be performed asynchronously so as not to block. I ran into some issues when trying to save hashed passwords into the databse using the Bookshelf.js ORM - here is how I resolved them.
Read More
Jul 26, 2015
Fixing error messages that I got when setting up MongoDB.
Read More
Jul 24, 2015
At first glance, JavaScript may not seem like an object oriented programming (OOP) language, but it does have powerful object oriented programming capabilities. OOP features such as inheritance, polymorphism, and encapsulation are all enabled in JavaScript. However, being a very flexible language, there are several different ways to define classes and use them. Here’s an overview of all the different JavaScript class instantiation and inheritance patterns and how to implement them.
Read More
Jul 9, 2015
The beauty of hash tables is obscured in languages such as JavaScript that have built-in data structures for storing key-value pairs. In some languages, hash tables need to be constructed manually using primitive arrays. Aside from the ability to store associative data, hash tables have many performance advantages over other data structures. For example, the value of a key can be retrieved at constant time, independent of how many key-value pairs are in the hash table. Learning about how hash tables work is important, so here is an overview of the inner workings of hash tables.
Read More