Of all the data structures that I have studied so far, my favorite is probably the Tree. I’d like to introduce you to some of the basics. Caveat: If you’re unsteady with Linked Lists, I strongly recommend you practice that structure first. When you’re comfortable with pointers, traversal and reversal, you’re ready for Trees.

  1. Definition
    A tree is a collection of nodes that are linked together. Exactly one of these nodes is called the root. No node points to the root. …

By name alone, the most intimidating basic algorithmic technique is dynamic programming. The definition sounds simple enough. The code should transform a complex “problem into a sequence of simpler problems.” One of the most straightforward ways to simplify these complex problems is to store the values of smaller examples into an array or hash for future use. This becomes more natural with time, so let’s take a look at a few examples.

1. Rocky at the Philly Art Museum

Noted computer programmer Rocky Balboa has a lesser-known boxing career.


Rocky Balboa wants to climb the steps outside the Philadelphia Museum of Art. There are 72 stone steps from the…

One of my favorite programs for macOS is Ubersicht, which renders custom widgets to the desktop. The widgets available for download can be out-of-this world; some developers have published widgets to track the International Space Station or check the weather on Mars.

I have written more modest widgets, because I think Ubersicht serves best when its output is informative and unobtrusive. Widgets are built with a combination of JavaScript and shell scripting. Essentially, you build a component in React, and Ubersicht positions the JSX to the desktop. …

What’s a linked list? I don’t mean a news aggregator like Reddit, a guide to local golf course, or a catalogue of chains. I certainly don’t mean a register of video game characters.

Let’s pretend that you’re the manager of a professional baseball team. The bus pulls up the hotel, where you have many reservations for the players.

The ordinary managerial practice is to book a block of rooms on the same hall and to assign players to rooms based on their position. …

Ruby includes a type of Proc called a lambda. What’s the fuss? Why have a separate kind of Proc?

The lambda expressions are the expressions of the lambda calculus, a topic in theoretical computer science. They were developed by a mathematician named Alonzo Church.

A rare photography of a mathematician smiling. Source:
A rare photography of a mathematician smiling. Source:

At the most basic level, a lambda expression permits us to model any computable function.

As a trivial example, a familiar function f(x) = x + 3 can be translated to an anonymous lambda expression like so:


Church proved that lambda expressions can model all computations. Turing, his contemporary, proved the same with his…

Ready for a DRY read?

The class definitions of an object-oriented approach remind me of the construction of some topics in math, like number systems. We start with a strict description of an atom, and we can build molecules. In this example, we mimic the formal construction of the Naturals, proceed to ordered pairs and equivalence classes, and thereby describe Integers and Rationals.

DRY, but WHY?

Well, computers are very good at math; I am not. There are uncountably many numbers, and I have seen about 0% of them. Nonetheless, the computer seems to have some difficulties with arithmetic. For…


Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store