• ↑↓ to navigate
  • ↵ to open
  • ⟶ to select
  • ⌘ ⌥ ↵ to open in a panel
  • ←→ to navigate
  • esc to dismiss
⌘ '
keyboard shortcuts

The Problem

How do we compare algorithm efficiency without being tied to specific hardware or machine details?

Core Idea

Big O notation describes the upper bound on the growth rate of a function, allowing comparison of algorithms based on how their resource requirements scale with input size, ignoring machine-dependent constants.

How It Works

Big O describes asymptotic behavior as input grows large:

  • O(1) - constant time
  • O(log n) - logarithmic time
  • O(n) - linear time
  • O(n²) - quadratic time
  • O(2^n) - exponential time

The notation focuses on dominant terms, ignoring lower-order terms and constants.

Key Properties

  • Describes upper bound (worst-case growth)
  • Ignores machine-specific constants
  • Focuses on asymptotic behavior
  • Used for time and space complexity
  • Essential for comparing algorithms

Visual Explanation

Big_O_Notation A Big O Notation Input B Big O Notation Core Mechanism A->B triggers C Big O Notation Output B->C produces

Semantic Network

semantic_Big_O_Notation THIS Big O Notation REL1 Related Concept THIS--REL1 related REL2 Builds Into THIS--REL2 builds into

Edge Cases & Gotchas

  • Big O gives upper bound—actual performance may be better
  • Constants matter in practice for small inputs
  • Must consider best, average, and worst case