A Singly Linked List
Nodes, ownership, and traversal.
What a Linked List Is
A singly linked list chains values together: each node holds a value and a pointer to the next node, or null at the end. 🔗
Define the Node
A node is a struct with a value and an optional pointer to the next node. Optional means the last node points at null.
const Node = struct {
value: i32,
next: ?*Node,
};