Free keyword research tools in SEO Fundamentals - Time & Space Complexity
When using free keyword research tools, it's important to understand how their performance changes as you search for more keywords or analyze larger data sets.
We want to know how the time taken grows when the number of keywords or search queries increases.
Analyze the time complexity of this simplified keyword research process.
function fetchKeywordData(keywords) {
let results = [];
for (let keyword of keywords) {
let data = fetchFromAPI(keyword); // fetch data for one keyword
results.push(data);
}
return results;
}
This code fetches keyword data one by one from an API for each keyword in the list.
Look at what repeats as the input grows.
- Primary operation: Fetching data for each keyword from the API.
- How many times: Once for every keyword in the input list.
As you add more keywords, the number of fetch operations grows directly with the number of keywords.
| Input Size (n) | Approx. Operations |
|---|---|
| 10 | 10 fetches |
| 100 | 100 fetches |
| 1000 | 1000 fetches |
Pattern observation: The time grows in a straight line as you add more keywords.
Time Complexity: O(n)
This means the time to get all keyword data grows directly in proportion to the number of keywords you check.
[X] Wrong: "Fetching data for multiple keywords happens all at once, so time stays the same no matter how many keywords."
[OK] Correct: Each keyword requires a separate fetch operation, so more keywords mean more time overall.
Understanding how time grows with input size helps you explain performance in real tools and shows you can think about efficiency clearly.
What if the tool fetched data for all keywords in one batch request? How would the time complexity change?