### Understanding Computational Complexity
Big-O notation describes the upper bound on the time or memory space required by an algorithm as input size $n$ grows toward infinity:
- $O(1)$: Constant time (array lookup by index).
- $O(\log n)$: Logarithmic time (binary search).
- $O(n)$: Linear time (single pass through array).
- $O(n \log n)$: Linearithmic time (merge sort).
- $O(n^2)$: Quadratic time (nested comparison loops).
example.pyPython 3.11
def find_first(arr):
return arr[0] # O(1)