\[ \mbox{} \]
\[ \Large \log_b(x) \mbox{ is the number you raise } b \mbox{ to to get } x. \]
\[ \mbox{} \]
Don’t like the grammar? Put it in your own words.
Recursive case of divide and conquer recurrence:
\[ T(n) = rT(n/c) + O(f(n)) \]
Join your table group and discuss the following. Write any observations you have on the Jamboard.
\[ T(n) = rT(n/c) + O(f(n)) \] - Notice any other patterns or rules-of-thumb?
QuickSort(A[1 .. n]):
if (n > 1)
r <- Partition(A, 1)
QuickSort(A[1 .. r − 1])
QuickSort(A[r + 1 .. n])
With mild assumptions/modifications, we can hope that the pivot will fall in the middle third at each stage:
This doesn’t exactly match the Master Theorem, but we can still use it.
Table #1 | Table #2 | Table #3 | Table #4 | Table #5 | Table #6 | Table #7 |
---|---|---|---|---|---|---|
Logan | Bri | Drake | Ethan | Nathan | Blake | Grace |
Trevor | Josiah | Jordan | Levi | Isaac | Kristen | Talia |
Graham | Claire | Kevin | Andrew | Jack | John | James |
\[ C(n) = \left\{\begin{array}{lr} 1, & \text{for } n=2,\\ 3C\left(\left\lceil\frac{2}{3}n\right\rceil\right) + K, & \text{for } n>2.\\ \end{array}\right. \]
Use a recursion tree (with root \(K\)) to solve this recurrence. What effect did adding the constant term have?