712 views
1 votes
1 votes

When analyzing a recurrence of the form T(n) = a T(nb) + θ(nc), under which of the following conditions can we conclude that “most of the work occurs at the leaves of the recursion tree”?

  1.   c <loga
  2.   c = logb a
  3.   c > logb a
  4.   None of these

1 Answer

Best answer
1 votes
1 votes

Answer: Option (A)

  • Case 1: f(n) is O(nlogba - ε). Since the leaves grow faster than f, asymptotically all of the work is done at the leaves, and so T(n) is Θ(nlogb a).
  • Case 2: f(n) is Θ(nlogba). The leaves grow at the same rate as h, so the same order of work is done at every level of the tree. The tree has O(lg n) levels, times the work done on one level, yielding T(n) is Θ(nlogb a lg n).
  • Case 3: f(n) is Ω(nlogba + ε). In this case we also need to show that af(n/b)≤kf(n) for some constant k and large n, which means that f grows faster than the number of leaves. Asymptotically all of the work is done at the root node, so T(n) is Θ(f(n)).
selected by

Related questions

1 votes
1 votes
1 answer
1
sripo asked Nov 14, 2018
1,599 views
T(n)=T(n/2)+2; T(1)=1when n is power of 2 the correct expression for T(n) is:a) 2(logn+1)b) 2lognc)logn+1d)2logn+1
1 votes
1 votes
2 answers
2
5 votes
5 votes
1 answer
4