Singletons: For & Against

In this article we will explore the controversial topic of singletons. For some, this singleton pattern an anti-pattern to be avoided at all costs, for others they are just a way of handling situations where we want to restrict the instantiation of a particular class to one instance where we would want to be able... » read more

Trees (BSTs & RBTs)

A tree is a data structure with multiple branching, they are made up of nodes, and each tree has a root node, and each root node will have zero or more child nodes, and each child node in turn can also have zero or more child nodes etc. Nodes at the bottom of the tree,... » read more

Higher Order Functions (in Swift & Python etc)

Higher-Order Functions are functions that can take one or more functions as arguments, these functions may also return functions.  in other words they take one or more functions as arguments (i.e. procedural parameters), and/or returns a function as their results. Functions that are not higher-order functions are called first-order functions. For programmers, the first instances of... » read more

Fibonacci, the Golden Ratio & Memoization

Let’s begin by defining the two key topics which will be explored in this article: Firstly, the Fibonacci Sequence is a series of numbers where a given number is found by adding up the two numbers preceding it. The sequence reveals something about the deep laws of the universe, and as such it appears in many places in nature, including things like plants... » read more

Big-O Notation (Part II)

In this article, we continue to explore Big-O, which is a notation we use to describe algorithmic efficiency. If you haven’t read part one, you might like to read that part first. In the last article we talked about where Big-O notation came from, and what notation we might expect to discover for an efficient... » read more

Big-O Notation (Part I)

History of the Notation Big O Notation is a shared representation (a language if you like) used in computer science to describe how long an algorithm could take to run, and indeed the likely storage or space requirements involved. It “is used to classify algorithms according to how their running time or space requirements grow as the... » read more