Quick & Dirty Notes / Mini-Quiz: LinkedLists

A quick cheat sheet / mini-quiz on LinkedLists to brush up on the fundamentals.

This blog post will be formatted with a question and then a corresponding answer. I find that having a question posed can help solidify my ability to recall information as well as force me to have a better understanding of the topic. See if it does the same for you.

As you go through the blog try to answer the questions in your own words before looking at the provided answer.

What is a Linked List?

What is a Node?

What are the two types of Linked Lists — how are they different?

What are the Pros and Cons of these two type of lists?

*When to use: when you have less memory or want to be careful about how much memory you have to use and your main goal is fast insertion and deletion → especially if you only insert to the front or end (think stack).

*When to use: good for when you don’t have many limitations for memory and when searching for elements.

Why would Linked Lists be better than Arrays or HashTables?

What are the bigO for linked list operations?

What is a pointer?

Define the structure of a linked list.

When defining a linked list, what is instantiated within the constructor method?

How does garbage collection impact Linked Lists?

How would you write a linked list class?

Depending on the language you’re most familiar with the answer may vary. But take some time to walk through a solution. Consider what operations are inherent to linked lists, and try writing out a class definition for an array in pseudo-code (or actual code) and see how well you understand it.

That’s it for this mini-quiz/cheatsheet. Hope it tickled your brain and you had some fun!

Just another one of those dreamers with a sparkle in his eyes.