Recall & Review
beginner
What is Big O notation?
Big O notation is a way to describe how the time or space needed by an algorithm grows as the input size grows. It helps us understand the efficiency of algorithms.
Click to reveal answer
beginner
What does O(1) time complexity mean?
O(1) means the algorithm takes the same amount of time to run, no matter how big the input is. This is called constant time.
Click to reveal answer
intermediate
Explain the difference between O(n) and O(n²) time complexity.
O(n) means the time grows linearly with input size. O(n²) means the time grows much faster, roughly the square of the input size, which is slower for large inputs.
Click to reveal answer
intermediate
Why do we ignore constants and lower order terms in Big O notation?
Because Big O focuses on how the algorithm behaves as input grows very large, constants and smaller terms become less important and don't affect the overall growth rate.
Click to reveal answer
beginner
Give a real-life example to understand O(log n) time complexity.
Searching for a word in a dictionary by opening it in the middle and deciding which half to look next is like O(log n). Each step cuts the search space in half, making it very efficient.
Click to reveal answer
Which of the following represents the fastest growing time complexity?
✗ Incorrect
O(n²) grows faster than O(n), O(log n), and O(1) as input size increases.
What does O(n) mean in terms of algorithm performance?
✗ Incorrect
O(n) means the time increases directly in proportion to the input size.
Why do we use Big O notation?
✗ Incorrect
Big O notation describes how the running time or space needs grow as input size increases.
Which time complexity is better for large inputs?
✗ Incorrect
O(1) is the best because it does not grow with input size.
If an algorithm takes 5n + 10 steps, what is its Big O notation?
✗ Incorrect
Constants and smaller terms are ignored, so it simplifies to O(n).
Explain in your own words what Big O notation tells us about an algorithm.
Think about how time changes when input gets bigger.
You got /4 concepts.
Describe a real-life example that helps you understand O(log n) time complexity.
Consider how you find a word in a phone book or dictionary.
You got /3 concepts.