DoxigAlpha

Function parameters

Parameters

#
list:*SinglyLinkedList
new_node:*Node

This struct contains only a next pointer and not any data payload.

Types

#
Node
This struct contains only a next pointer and not any data payload.

Functions in this namespace

Functions

#
popFirst
Remove and return the first node in the list.
len
Iterate over all nodes, returning the count.

Source

Implementation

#
pub fn prepend(list: *SinglyLinkedList, new_node: *Node) void {
    new_node.next = list.first;
    list.first = new_node;
}