Iterate over all nodes, returning the count.
This operation is O(N). Consider tracking the length separately rather than computing it.
pub fn len(list: SinglyLinkedList) usize
pub fn len(list: SinglyLinkedList) usize {
if (list.first) |n| {
return 1 + n.countChildren();
} else {
return 0;
}
}