5 Written questions
5 Matching questions
- What is sometimes called a boxed integer?
- What are the two fields of a cons cell called?
- What is a pointer (aka reference)?
- How many links does a node that isn't the root have coming into it?
- For reference types, what do == and != test?
- a The equality of pointer values (i.e. do they have the exact same data address in memory?)
- b Integer in Java, a record that has a class, has methods, can be pointed to and used in other structures.
- c car and cdr (original names), or first and rest.
- d Exactly one
- e The memory address of the beginning of a record, or block of storage
5 Multiple choice questions
- nothing; a sentinel is an extra node, usually at the front or end, that simplifies coding.
- A linked list links new elements onto the front of the list.
- a stack that keeps a fresh set of values for each variable in a stack frame
- It looks like an ordinary tree, but the right hand links all fall down and become horizontal.
5 True/False questions
What does it mean for functions to share structure? → It can only be computed when n is relatively small (for example, if the function is exponential)
What is the term for items being inserted at the end of a queue? → enqueued
With respect to linked lists, what does .set(idx, element) do? → The number of "things" in the linked list
What does the function reverse() do to a linked list? → It reverses a list in place by turning the pointers around.
What is the Big O of accessing some element in the middle of an ArrayList? → O(1)