chickadee » sparse-vectors » alist->sparse-vector

alist->sparse-vector ALIST #!optional DEFAULTprocedure

Returns a new sparse-vector for the ALIST.

ALIST ; (list-of (pair INDEX VALUE))
DEFAULT ; * ; value for indices whose elements have not been set, default #f.

The DEFAULT should be disjoint from the set-of element types, see VALUE.

An O(n) operation, where n is (length ALIST).