Big O Notation
Big O Notation
The algorithm's execution time remains constant regardless of input size. For
example, accessing a specific element in an array.
The time increases slowly as input size grows, typical in algorithms like binary
search where each step halves the problem size.
Execution time grows proportionally with input size, such as traversing a list.
Common in efficient sorting algorithms like merge sort and quicksort, where the
process involves dividing and conquering.
Time increases quadratically with input size, often seen in algorithms with nested
loops, such as bubble sort.
Execution time doubles with each additional input element, making such algorithms
impractical for large data sets. Examples include certain brute-force search
algorithms.