llength: Compute the length of a linked list.

Description Usage Arguments Value

Description

This function computes the length of a linked list by scanning through it. This is thus a linear time function.

Usage

1
llength(llist, acc = 0)

Arguments

llist

The linked list

acc

An accumulator (for making the function tail-recursive)

Value

The length of llist


mailund/pmtypes documentation built on Jan. 31, 2020, 1:09 p.m.