5 Written questions
5 Matching questions
- What is the Big O of binary search?
- In a Cons list, first and rest have different types. What are they?
- What does a sentinel node hold or reference?
- What does the function nreverse do?
- When the ratio of times as the size of input is doubled is about 8, what is the Big O?
- a First can be any Object type, while rest is a Cons or null
- b nothing; a sentinel is an extra node, usually at the front or end, that simplifies coding.
- c O(n³)
- d It reverses a list in place by turning the pointers around.
- e O(log(N))
5 Multiple choice questions
- A simple item such as a number or string or a balanced pair of parentheses and everything inside of them.
- A directed pointer from one node to another
- 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.
5 True/False questions
What is the Big O of inserting at the front of a LinkedList? → O(N)
What does it mean to divide and conquer? → To break down a large problem into two smaller problems, until the problem becomes easy
What is an abstract data type? → It is a list of pairs, where each pair has a key, and a value associated with the key. ((one 1) (two 2) (three 3))
What is the term for items being removed from the front of a queue? → O(1)
What does depth-first search do? → It searches children of a node before siblings are considered (through recursion)