MIT Programming Fundamentals Review
- 26Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
26 questions
- 1The primary focus of measuring efficiency in this lecture is_____efficiency, rather than space.
Hint
Think about what aspect of performance the lecturer emphasizes as most important.
Answer
time
- 2Two reasons to care about algorithm efficiency are predicting runtime and understanding how design choices influence_____.
Hint
The lecturer mentions two reasons: prediction and the effect of design decisions on performance.
Answer
time
- 3Timing an algorithm as a measure of efficiency is flawed because it depends on implementation, the computer, and does not necessarily predict performance on_____inputs.
Hint
The lecturer mentions that small-scale tests may not reflect behavior when the problem grows.
Answer
large
- 4Counting primitive operations as a measure of efficiency is still dependent on_____.
Hint
The lecturer notes that even operation counts can vary with different implementations.
Answer
implementation
- 5Order of growth abstracts away additive and multiplicative_____.
Hint
We ignore the small factors that don't affect asymptotic behavior.
Answer
constants
- 6Big O notation describes the_____case upper bound on the growth of runtime as input size increases.
Hint
The lecturer states they will focus on the worst-case scenario.
Answer
worst
- 7In Big O notation, we consider the_____behavior as the input size becomes very large.
Hint
This refers to what happens when n grows without bound.
Answer
asymptotic
- 8For a polynomial expression like n2+2n+2, the dominant term and thus the order of growth is_____.
Hint
The term with the highest degree determines the asymptotic behavior.
Answer
n2
- 9For the expression 100000n2+n, the order of growth is_____.
Hint
Ignore the coefficient and lower-order terms.
Answer
n2
- 10For the expression n30+3n, the dominant term for large n is_____.
Hint
Compare a power function to an exponential; exponentials grow faster.
Answer
3n
- 11A constant runtime algorithm is denoted as O(_____).
Hint
Think about the number 1, representing fixed time.
Answer
1
- 12A logarithmic runtime is denoted as O(_____).
Hint
The runtime grows slowly, like the logarithm of the input size.
Answer
logn
- 13A linear runtime means that if you double the input size, the runtime_____.
Hint
Linear relationship: factor of 2 in input gives factor of 2 in time.
Answer
doubles
- 14A quadratic runtime means that if you double the input size, the runtime_____.
Hint
Quadratic: factor of 2 in input gives factor of 4 in time.
Answer
quadruples
- 15An exponential runtime grows much faster than polynomial; for example, 2n is worse than_____.
Hint
Compare exponential to polynomial; exponential dominates eventually.
Answer
n2
- 16The law of_____for orders of growth says that for sequential code, the overall order is the sum, dominated by the largest term.
Hint
This law deals with combining independent blocks of code.
Answer
addition
- 17The law of_____for orders of growth says that for nested loops, the orders multiply.
Hint
This law applies when one loop is inside another.
Answer
multiplication
- 18A simple iterative loop that runs n times with constant work per iteration has order of growth O(_____).
Hint
Think about the number of iterations relative to input size.
Answer
n
- 19Linear search in an unsorted list has worst-case complexity O(_____), where n is the length of the list.
Hint
You may have to check every element.
Answer
n
- 20Even if the list is sorted, the linear search algorithm still has worst-case complexity O(_____).
Hint
Though you can stop early if the element is greater, the worst case still requires scanning all elements.
Answer
n
- 21Accessing the i-th element of a Python list takes_____time due to base+offset addressing.
Hint
The lecture explains that indexing is done directly without iteration.
Answer
constant
- 22For heterogeneous lists, Python uses_____to allow constant-time access to any element.
Hint
This technique stores pointers instead of actual values.
Answer
indirection
- 23A nested loop where both loops run n times typically has order of growth O(_____).
Hint
Multiply the complexities of the two loops.
Answer
n2
- 24The subset check algorithm with two nested loops has worst-case complexity O(_____) when both lists are of length n.
Hint
For each element in the first list, you scan the second list.
Answer
n2
- 25The intersection of two lists algorithm using nested loops and membership test has overall complexity O(_____) if both lists are of length n.
Hint
The two nested loops plus the membership check contribute to quadratic behavior.
Answer
n2
- 26The trade-off between time and space efficiency is illustrated by using a dictionary to store intermediate values in computing_____.
Hint
This example from the lecture showed time savings by storing prior results.
Answer
Fibonacci

Ask anything
We've read this whole study set, so questions about it get the best answers.