5 Written questions
5 Matching questions
- O(log(n)) is better than which function?
- What does the function nconc do?
- How can you find the Big O of a loop?
- What is the output:
(member 'dick '(tom dick harry))
- What does the function append() do to a linked list?
- a 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
- b The loop count times the Big O of the contents
- c O(N). Much, much better.
- d (dick harry)
- e It concatenates two lists to form a single list.
(append '(a b c) '(d e)) = (a b c d e)
5 Multiple choice questions
- == or !=
- The last link points back to the front of the list rather than to null or nil
- It returns the set of elements that are members of either set (basically all elements with no duplicates).
(union '(i c e) '(c r e a m)) = (i c r e a m)
- a stack that keeps a fresh set of values for each variable in a stack frame
- A simple item such as a number or string or a balanced pair of parentheses and everything inside of them.
5 True/False questions
What is a doubly linked list? → A tree in which each node has at most two children
What are the advantages to ArrayList? → get and set are O(1), and add and remove at the end are O(1) so it makes a good stack
What is well-founded ordering? → ordering that can guarantee to terminate (go down to zero)
How many links does a node that isn't the root have coming into it? → O(1)
What is a reference? → A kind of graph composed of nodes and links. It has one root node. Each node except the root has exactly one parent. All nodes are reachable from the root.