5 Written questions
5 Matching questions
- What is the Big O of accessing some element in the middle of an ArrayList?
- What does it mean for a function to be intractable?
- To compare against null, what should be used?
- How can you find the Big O of an if statement?
- What does it mean to divide and conquer?
- a It can only be computed when n is relatively small (for example, if the function is exponential)
- b The max of the Big O of the test, then statement, and else statement
- c To break down a large problem into two smaller problems, until the problem becomes easy
- d O(1)
- e == or !=
5 Multiple choice questions
- First can be any Object type, while rest is a Cons or null
- A linked list links new elements onto the front of the list.
- Slowly. log(1000) = 10, log(1,000,000) = 20, log(1,000,000,000) = 30.
- It provides a simple lookup tool to find information in a linked list. (assoc 'b '((a 1) (b 2) (c 3))) = (b 2)
- It tests whether a given item is an element of a list. It returns the remainder of the list beginning with the desired element
5 True/False questions
What are the advantages of LinkedList? → Something as simple as a number, or a pointer to another linked list
What is the term for items being removed from the front of a queue? → dequeued
What is the output:
(member 'dick '(tom dick harry)) → (dick harry)
What are the different representations of trees that we are concerned with for Novak's class? → O(N)
What does a sentinel node hold or reference? → nothing; a sentinel is an extra node, usually at the front or end, that simplifies coding.