Functional Problem Solving (CSC 151 2014F) : EBoards

CSC151.01 2014F, Class 40: Vectors


Overview

Preliminaries

Admin

Upcoming Work

Extra Credit Opportunities

Academic

Peer Support

Questions

How do I do other cool things with GIMP/gigls?

There's a huge list of procedures under Help -> Procedure Browser. You can call most of them, although the arguments are a bit strange in some cases.

Reading check

With your partner:

Most important points

Why do vectors in addition to lists?

Sometimes we want quick access to values; lists are slow, vectors are fast (by index).

Vectors let you change their contents.

Why have lists if we have vectors?

Lists can be expanded easily; vectors can't.

Lists are really easy to recurse over.

Huge number of procedures

Confusing issues

Why would you ever want vector-fill! (particularly given that we could just use make-vector)?

Mostly there to help you think about recursion over vectors.

How do we make vectors bigger?

You can't.

What's a number vector?

A vector that contains only number.

Behind the scenes: How Scheme implements vectors

Laid out in a continuous area of memory. Let's say it starts at location m. Every value takes the same amount of space, s. That means that value i is at position m+si.

Lab