5 Written questions
5 Matching questions
- What is well-founded ordering?
- What does the function nreverse do?
- What does the function nconc do?
- What is a runtime stack?
- What will a filter function do?
- a a stack that keeps a fresh set of values for each variable in a stack frame
- b It concatenates two lists to form a single list; it does so by modifying the end of the first list to point to the second list
- c Filter removes items from a Collection if they meet a certain condition
- d It reverses a list in place by turning the pointers around.
- e ordering that can guarantee to terminate (go down to zero)
5 Multiple choice questions
- Integer myInteger = Integer.valueOf(myInt);
Integer myInteger = myInt; // autoboxing
- O(n*log(N)), but could be O(n²) in the worst case.
- A queue
- Access to any element has the same cost, O(1); (for example, arrays)
5 True/False questions
What does it mean for a function to be intractable? → The same list structure is part of more than one list.
What does the function Union do? → It provides a simple lookup tool to find information in a linked list. (assoc 'b '((a 1) (b 2) (c 3))) = (b 2)
What does the following produce?
(rest (rest '((a b) c))) → null
What are the disadvantages of ArrayList? → get, set, and remove are O(N)
What is a constructive function? → A function that creates a new list, but does not modify the original list's arguments