Key Concepts

Review core concepts you need to learn to master this subject

Linked List data structure

A linked list is a linear data structure where elements are not stored at contiguous location. Instead the elements are linked using pointers.

In a linked list data is stored in nodes and each node is linked to the next and, optionally, to the previous. Each node in a list consists of the following parts:

1) data 2) A pointer (Or reference) to the next node 3) Optionally, a pointer to the previous node

Linked Lists: Python
Lesson 1 of 1
  1. 1
    Let’s implement a linked list in Python. As you might recall, each linked list is a sequential chain of nodes. So before we start building out the LinkedList itself, we want to build up a Node clas…
  2. 2
    With the Node in hand, we can start building the actual linked list. Depending on the end-use of the linked list, a variety of methods can be defined. For our use, we want to be able to: - get the…
  3. 3
    So far we can: - create a new LinkedList using .init() - get the head node of the list using .get_head_node() Next up, we’ll define methods for our LinkedList class that allow us to: - insert…
  4. 4
    Nice! Now we have a bunch of helpful LinkedList methods under our belt. The final use case we mentioned was the ability to remove an arbitrary node with a particular value. This is slightly more …
  5. 5
    Congratulations, you have implemented a linked list in Python! We did this by: - Defining a Node class to hold the values and links between nodes - Implementing a LinkedList class to handle extern…

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo