This preview shows pages 1–2. Sign up to view the full content.
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 BigO?
BigO 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
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview. Sign up
to
access the rest of the document.
 Fall '05
 MarkDrela

Click to edit the document details