5 Written questions
5 Matching questions
- With respect to linked lists, what does .set(idx, element) do?
- What are the two fields of a cons cell called?
- What is inorder?
- What is the output:
(member 'dick '(tom dick harry))
- What does it mean for a function to be intractable?
- a It can only be computed when n is relatively small (for example, if the function is exponential)
- b an order of processing a tree in which the parent node is processed in between its children
- c Replaces the element at the specified position in this list with the specified element.
- d car and cdr (original names), or first and rest.
- e (dick harry)
5 Multiple choice questions
- A function that modifies the original list's arguments
- A function that creates a new list, but does not modify the original list's arguments
- getFirst, addFirst, removeFirst, getLast, addLast, removeLast are all O(1)
- It concatenates two lists to form a single list.
(append '(a b c) '(d e)) = (a b c d e)
5 True/False questions
What is the Big O of inserting at the front of an array or an ArrayList? → O(1)
What is a First-Child / Next-Sibling Tree? → Filter removes items from a Collection if they meet a certain condition
When the ratio of times as the size of input is doubled is somewhat larger than 2, what is the Big O? → O(n²)
What is the Big O of inserting in the middle of an ArrayList? → O(N)
What is a root? → In a tree, it is a node that points to a given node