Big-O

Software Concepts

Big-O notation is a way of describing how the performance of an algorithm changes as the amount of data it processes increases. It is commonly used to compare algorithms based on how much time or memory they require as their input grows.

Rather than measuring exact execution time, Big-O describes the general rate of growth. For example, an algorithm described as O(n) takes roughly twice as much work when the amount of input doubles, while an O(n²) algorithm may require around four times as much work.

Key Characteristics

Big-O notation focuses on how an algorithm behaves at larger scales and ignores small differences such as constant processing costs. Common examples include O(1) for constant time, O(log n) for logarithmic growth, O(n) for linear growth, and O(n²) for quadratic growth.

Lower growth rates generally scale better as datasets become larger. Developers use Big-O notation when choosing algorithms, designing data structures, and identifying code that may become slow or memory intensive as an application grows.