|
|
Vectors |
Vectors in Scheme are heterogeneous array-like data structures of a fixed size |
|
|
|
The main difference between lists and vectors is the mode of access and the mode of construction | There is direct access to the elements of a vector. List elements are accessed by traversing a chain of references. This reflects the basic differences between arrays and linked lists. The mode of construction for list is recursive, using the cons function. Lists are created incrementally: New elements can be created when needed, and prepended to the list. Vectors are allocated in one chunck, and cannot be enlarged or decreased incrementally. |