Algorithms
Computer Science
Interviews
Understanding Big-O Notation for Beginners
F
|Jul 22, 2026Farhan
@farhan
Ask anything about this article
Hi! I've read this article.
What would you like to know?
@farhan
Big-O notation tells us how our algorithm scales as the input size grows.
Accessing an array element by its index arr[5] takes the same amount of time whether the array has 10 items or 10 million items.
Looping through an array to find a specific value. If the array is twice as large, it takes twice as long.
A nested loop. If you have an array of 10 items and compare every item to every other item, that's 100 operations. This scales terribly and should be avoided for large datasets.