DAA Module 1 02 / 04

What is input size (n)?

Before you say “O(n²)”, define what n means. In many problems you have more than one size parameter.

Interactive: choose problem type

See how we define input size and how complexity is written.

Why students lose marks here
  • Writing “O(n²)” without defining n.
  • Ignoring second parameter (graph: edges, string: pattern length).
  • Comparing two algorithms with different “n meaning”.
Quick check

For BFS, is input size just n? No → it depends on |V| and |E|.

Next step

Now that n is clear, use Growth Visualizer to compare common complexity functions.

Open 03 — Growth Visualizer →