Data structures: the other cornerstone of a competent software engineer. This is why I’m compiling all my research and work on the topic in a series of articles titled Data Structures Decoded.
In the fourth part of our look at Singly Linked Lists, we created an .unshift() instance method.
In today’s article, we’ll be exploring how to add a .get() function to our Singly Linked List class.
Let’s take a look at the pseudocode we’ll need to translate into Javascript:
Data structures: the other cornerstone of a competent software engineer. This is why I’m compiling all my research and work on the topic in a series of articles titled Data Structures Decoded.
In the second part of our look at Singly Linked Lists, we created a .shift() instance method.
In today’s article, we’ll be exploring how to add an .unshift() function to our Singly Linked List class.
Let’s Unshift Gears
Here’s the pseudocode:
Data structures: the other cornerstone of a competent software engineer. This is why I’m compiling all my research and work on the topic in a series of articles titled Data Structures Decoded.
In the second part of our look at Singly Linked Lists, we created a .pop() instance method, a method common in other structures like Arrays.
In today’s article, we’ll be exploring how to add a .shift() function to our Singly Linked List class.
In arrays, .shift() removes the first element of the array. While the goal is the same, its implementation with our Singly Linked List is slightly…
Data structures: the other cornerstone of a competent software engineer. This is why I’m compiling all my research and work on the topic in a series of articles titled Data Structures Decoded.
In today’s article, we’ll be exploring how to add a .pop() function to our Singly Linked List class.
In the first part of our look at Singly Linked Lists, we examined how we can use the Class syntax to create a Singly Linked List class. In it, we created a .push() instance method, a method common in other structures like Arrays.
So, creating .pop() functionality isn’t as straightforward…
Data structures: the other cornerstone of a competent software engineer. This is why I’m compiling all my research and work on the topic in a series of articles titled Data Structures Decoded.
In today’s article, we’ll be exploring the basics of a Singly Linked List.
A linked list is a ordered data structure that stores any kind of data you’d like. It contains a head, a tail, and a length property. Linked lists consists of nodes and each node has a value and a pointer to another node or null.
A useful exercise to increase our understanding of a singly…
Data structures: the other cornerstone of a competent software engineer. This is why I’m compiling all my research and work on the topic in a series of articles titled Data Structures Decoded.
Today’s article is a special one: it marks the official start of our exploration of the subject!
Let’s take a look at what a data structure is according to Wikipedia:
A data structure is a data organization, management, and storage format that enables efficient access and modification.[1][2][3]More …
Algos, algos, algos: the cornerstone of a competent software engineer. This is why I’m compiling all my research and work on the topic in a series of articles titled Algorithm Action.
Today, we’re wrapping up our exploration of Object Oriented Programming in Javascript.
In part one, I covered how Javascript handles Object Oriented Programming without actually being an OOP-based programming language. We covered classes, constructors, and instance method. Now, we’re diving a little more deeply into class methods.
Also known as static methods, class methods are used only with entire classes rather than instances of that class. …
Algos, algos, algos: the cornerstone of a competent software engineer. This is why I’m compiling all my research and work on the topic in a series of articles titled Algorithm Action.
Today, we’re exploring using Object Oriented Programming in Javascript.
Technically, Javascript doesn’t support OO programming but in 2015 introduced the Class syntax. A Class is a blueprint for creating objects with predefined properties and methods.
We’ll be using the Class syntax to define data structures.
The class keyword creates a constant. (Keep in mind you cannot redefine it.) The method to create new objects must be called constructor and…
Algos, algos, algos: the cornerstone of a competent software engineer. This is why I’m compiling all my research and work on the topic in a series of articles titled Algorithm Action.
Today, we’re wrapping up our exploration of merge sort.
In Part 1 of this series, we explored why we need a helper function to make merge sort work and defined it.
function merge(arr1, arr2){ let results = []; let i = 0; let j = 0; while (i < arr1.length && j < arr2.length) { if (arr2[j] > arr1[i]) { results.push[arr1[i]]; i++; } else { results.push(arr2[j]); j++; } }…
Photo by Noah Windler on Unsplash
Algos, algos, algos: the cornerstone of a competent software engineer. This is why I’m compiling all my research and work on the topic in a series of articles titled Algorithm Action.
Today, we’re beginning our exploration of merge sort.
Merge sort is a combination of splitting, sorting and merging actions. It works because it exploits the fact that arrays of 0 or 1 element are always sorted. Therefore, by decomposing an array into smaller arrays of 0 to 1 elements, it’s possible to build up a newly sorted array.
But to make it work…