Loading section...
O(n) -- Linear Time
An O(n) algorithm does work that grows in direct proportion to the input size. If processing one million rows takes one second, processing two million takes about two seconds. The relationship is a straight line on a graph, which is why it is called linear time. Linear algorithms are the workhorses of data engineering. Full table scans, aggregations, pandas vectorized operations, and single-pass transformations are all O(n). For many tasks, O(n) is the best you can possibly do, because you need to look at every row at least once. Why it matters: a table scan checks every row one at a time. The more rows you add, the more work the database must do, because it cannot skip anything it has not checked yet. Single-Pass Processing The most common O(n) pattern in data engineering is iterating thr