...

/

Example: A Simple Linked List

Example: A Simple Linked List

Understand the implementation of a simple linked list using pointers.

We'll cover the following...

Linked list

The elements of linked lists are stored as nodes. The concept of a linked list is based on each node pointing at the node that comes after it. The last node has no other node to point at, so it is set to null:

Linked list
Linked list

The figure above may be misleading; in reality, the nodes are not side-by-side in memory. Each node does point to the next node, but the next node may ...