What about the Average Case? - Idea:
- Assume that each of the n! permutations of A is equally likely.
- Compute the average over all possible different inputs of length N.
- Difficult to compute!
- In this course we focus on Worst Case Analysis!
See TimeComplexity Spreadsheet What is “goodness”? - Correctness
- Minimum use of “time” + “space”
- Uses a high-level description of the algorithm instead of an implementation
- Allows us to evaluate the speed of an algorithm independent of the hardware/software environment
- Estimate the growth rate of T(n)
- A back of the envelope calculation!!!
The idea - Write down an algorithm
- Using Pseudocode
- In terms of a set of primitive operations
- Count the # of steps
- Bound or “estimate” the running time
Growth Rate of Running Time
Do'stlaringiz bilan baham: |