How to combine the efficiency of insertion of a Linked List and the quick search of an ordered array.

“leafless tree on the hill” by Fabrice Villard on Unsplash

What is a Binary Search Tree?

Let’s start with basic terminology so we may share the same language and investigate related concepts. First, what are the principles that define a Binary Search Tree?


“Fans and wires on the back of a computer server” by Thomas Kvistholt on Unsplash

Like stacks and queues, Linked Lists are a form of a sequential collection. It does not have to be in order. A Linked list is made up of independent nodes that may contain any type of data. Each node has a reference to the next node in the link.


Photo by Mathieu Turle on Unsplash

A Stack is the most elemental of the data structures in computer science.

Data structures are a way to organize our information. They provide a means of storing different types of data in unique ways and methods to access either all or distinct parts of it.

Starting with a Stack

Have you ever used a stack? Of course! Your email is a form of a stack, new mail comes in and is placed on top. When you finish reading the latest email, you remove it from the top. In development, whenever you call a function, that is placed on a stack in the engine that processes the code.


credit: att systems group

Starting with a Queue

When you go the Shake Shack, most often there are other people on the line waiting to be served. The customers are arranged in a particular order, First In, First Out. Other real-life scenarios are toll booths or wedding chapels in Vegas. This method of ordering data for service, in our case, people, is what Queues are all about.


I’m going to say this right off the bat. Do you know the events that happen upon function invocation? No? Then that’s where we will start.

Function invocation

When we call a function, an execution context gets placed on the execution stack. Let’s break this down some more.


How Scope chain and closures work under the hood with examples.

Photo by Anurag Harishchandrakar on Unsplash

Understanding Scope and Closures in JavaScript

To dig deep and get the information you need, think like a journalist. Ask the six main questions: who, what, why, where, when, and how. If you can answer all these on a particular subject, then you have garnered the essence of what you need to know.

The what…

What is scope and why does it matter?

Scope is the context environment (also known…

Kevin Turney

Software Engineer, extreme DIY'er, husband, father, I build things.... pretty much anything.

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