Knowledge Card - Big O Complexities

Big O Complexities

  1. O(1): Constant time (e.g., accessing an array element).
  2. O(n): Linear time (e.g., traversing a list).
  3. O(n²): Quadratic time (e.g., nested loops).
  4. O(log n): Logarithmic time (e.g., binary search).
  5. O(n log n): Common in efficient sorting algorithms (e.g., merge sort, quicksort).