Bubble Sort

Running Time?

Question: how long will it take to run?

Ask instead: how many basic computer operations are needed?

Complexity:

- running time and worst case

Asymptotic Perspective:

Growth rate of worst-case running time as a function of input size.

We say:

  • if c such that
  • if
  • if
  • if such that

Polynomial Time: for some k Exponential Time: for some c

Interpreting : outgrows as n increases (definition of converging to 0).