Concept
A linked list is a chain of nodes, each pointing to the next (and in a doubly linked list, the previous). Inserting or removing a node you already hold is O(1), but reaching the nth node is O(n).
The tutor works through these with you, in conversation and code. A session ends when you have shown them, not when a video does.
A few lines that show Singly and doubly linked lists doing its job.
class Node:
def __init__(self, value, next=None):
self.value, self.next = value, next
head = Node(1, Node(2, Node(3)))
# insert 9 after the first node, without shifting anything
head.next = Node(9, head.next)
node = head
while node:
print(node.value) # 1 9 2 3
node = node.nextLosing the rest of the list by overwriting a next pointer before saving it. When relinking, capture the old next first, then point the node at the new one.
Your roadmap puts these before Singly and doubly linked lists, unless you already know them.
Once a session shows you understand Singly and doubly linked lists, it comes back for review. Each review takes a minute and tells the memory model how well you still know it.
Topics that build on Singly and doubly linked lists.