After last week’s post on linked lists, a tree is the next logical data structure to examine. Consisting of a series of nodes connected by pointers, trees are a top-down data structure with an N–1 child to parent ratio.
As previously mentioned, a tree is a node-and-pointer data structure. …
This guide is intended as a primer and refresher on the linked list data structure. It will cover the structure itself, its computational timings, its common algorithms, and how to code up its various permutations.
Linked lists are considered by many to be the most basic data structure, and it’s easy to see why. A linked list comprises a series of nodes, each of which contains a pointer to the next node in the series. This…
As technology grows and changes, it’s only natural that the methods of interacting with it (and its very form) will transform in order to best match the needs of its users. We can see this clearly in the myriad new programming language that have sprung up over the last decade, each attempting to more closely mirror the way that programmers think.
SQL, invented in the 70s by engineers working for IBM, has been a staple of database technology since its inception. By creating the ability to link tables together, SQL makes accessing associated data a simple process, and does wonders…
If you’re anything like me, Rust may have snuck up on you. With so many established programming languages, it can be hard to motivate oneself to learn yet another one, especially one as nascent as Rust. However, as more and more companies adopt this new language it’s starting to look like it’s here to stay. This article is aimed at helping you through a couple vital questions:
Sorting algorithms are an awkward combination of fundamentally necessary, and deeply contentious. From new engineers looking to impress in an interview to older engineers searching out a solution to a rapidly scaling database, there are myriad factors to take into consideration. What is the speed of comparison between two objects? What’s the swap time? How large is the database? What type of objects does it contain? Is it already semi-sorted? Do the results need to be stable?
To talk about the concept of
self in Ruby, one first needs to understand how Ruby works at a fundamental level. Namely, we need to discuss how everything in Ruby is either an object or a method.
Methods can be thought of as behaviors attached to an object, whereas objects are collections of inherited behavior with data. Let’s take a moment to break that down, starting with the object definition:
An object is a collection of inherited behaviors with data.
This can be demonstrated through looking at a basic class.
Here we create a…
Let’s consider the following code:
While disturbing, this code is 100% functional. It divides six by two and adds the result to three, then stores the result into sum. It does this while smeared over five lines, and with nineteen spaces sloshed in for good measure.
On the other hand, this code breaks:
An experienced coder will be nodding along at this point. You completed the sum statement, then went to a new line, declared +6, then went to line three where you…
Software engineer and writer who likes weird edge cases and talking about the world.