TLDR Web Dev · ARTICLES & TUTORIALS

BIG O

samwho.dev14 min read

Summary from the TLDR Web Dev newsletter

Big O notation is a way to describe a function's performance by showing how its execution time scales with the size of the input. This article explains four common Big O notations: constant O(1), logarithmic O(log n), linear O(n), and quadratic O(n^2), providing examples for each. It then discusses practical coding scenarios, such as finding items in lists, looping with indexes, and caching results, to demonstrate how understanding Big O can optimize code.