Staying updated on AI developments in AI for Everyone - Time & Space Complexity
We want to understand how the effort to stay updated on AI developments grows as the amount of new information increases.
How does the time needed change when there is more AI news and research to follow?
Analyze the time complexity of the following process.
for each new AI article in daily_feed:
read article
summarize key points
save summary
This process reads and summarizes each new AI article from a daily feed.
Look at what repeats as more articles arrive.
- Primary operation: Reading and summarizing each article.
- How many times: Once for every article in the daily feed.
As the number of articles grows, the total time grows too.
| Input Size (n) | Approx. Operations |
|---|---|
| 10 | 10 reads and summaries |
| 100 | 100 reads and summaries |
| 1000 | 1000 reads and summaries |
Pattern observation: The time grows directly with the number of articles; double the articles means double the work.
Time Complexity: O(n)
This means the time needed grows in a straight line with the number of new AI articles to read and summarize.
[X] Wrong: "Reading more articles doesn't take more time because I skim quickly."
[OK] Correct: Even skimming each article takes some time, so more articles always add up to more total time.
Understanding how tasks grow with input size helps you plan your learning and work efficiently, a skill valuable in many real-world situations.
"What if you only summarize every other article instead of all? How would the time complexity change?"