Solve the following recurrences:
(a) T(n) = T(n=2) + O(n), with T(1) = 1.
Solve this two times: one with the substitution method and one with
the master theorem from
CLRS. When you use the master theorem, carefully show the values
for the parameters a; b.
For the following cases you can use your preferred method. In
either case, show your work:
(b) T(n) = 2T(n/2) + O(1), T(1) = 1.
(c) T(n) = 3T(n/2) + O(1), T(1) = 1.
(d) T(n) = T(2n/3) + O(1), T(1) = 1.
(e) T(n) = T( √n) + O(1); T(2) = 1.
Note: In all the above examples you should give T(n) in
O-notation.
Get Answers For Free
Most questions answered within 1 hours.