m9 - Lecture C9 Response to 'Muddiest Part of the Lecture...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Lecture C9 Response to 'Muddiest Part of the Lecture Cards' (10 respondents) 1) What is T(n) ? We are trying to get an equation of the time taken to solve a problem of size n . We represent the total time taken as T(n) . We will see more of this in detail in the next lecture. 2) For T(n) = C s n/2, the bound was n/2 n, and we said that this was valid for n 1, so n0 = 1. But isn’t n/2 n valid for all n 0? Yes mathematically that is correct, but n=0 is an empty array, and the worst case, best case and average case are all constant time. 3) Why do we use Big-O? Big-O notation allows us to perform an asymptotic analysis on resource usage (the resource could be memory used or processor time). This allows us to compare two algorithms in terms of best case, worst case and average case behavior. If T(n) is the computation time of the algorithm, then its asymptotic behavior can be expressed as T(n) = O(f(n)) such that T(n) O(c f(n)), for all n n The two constants c and n
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

m9 - Lecture C9 Response to 'Muddiest Part of the Lecture...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online