You want to show that the solution of T(n) = 4T(n/2) + n is O(n²), using the substitution method. Unfortunately, if you simply recursively plug in Cn² to try to make the method go through, it doesn't work: on the left side of the inequality you are trying to prove you are left with an extra term, so the left side isn't the right side. The extra term is 0 However, you can make the proof work by modifying the induction. Instead of proving it is < Cn², instead, you prove that it is ≤ Cn² - Dn. The smallest value of D that will work is greater than or equi (Once you prove that T(n) ≤ Cn² - Dn, it is easy enough to show that that is € O(n²).)
You want to show that the solution of T(n) = 4T(n/2) + n is O(n²), using the substitution method. Unfortunately, if you simply recursively plug in Cn² to try to make the method go through, it doesn't work: on the left side of the inequality you are trying to prove you are left with an extra term, so the left side isn't the right side. The extra term is 0 However, you can make the proof work by modifying the induction. Instead of proving it is < Cn², instead, you prove that it is ≤ Cn² - Dn. The smallest value of D that will work is greater than or equi (Once you prove that T(n) ≤ Cn² - Dn, it is easy enough to show that that is € O(n²).)
Related questions
Question
data structure and algorithm
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 1 images