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”? c <logb a c = logb a c > logb a None of these Algorithms algorithms recurrence-relation + – Akriti sood asked Dec 27, 2016 Akriti sood 714 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
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)). Jason GATE answered Jan 22, 2017 • selected Jan 23, 2017 by Akriti sood Jason GATE comment Share Follow See all 7 Comments See all 7 7 Comments reply Show 4 previous comments Akriti sood commented Jan 23, 2017 reply Follow Share @jason,i am understanding all the things ,you are sayng but .just tell me this-" "Means , the root works θ(nc) and the children especially the Leaves work Θ(nlogba)." the recurrence is T(n) = a T(nb) + θ(nc) which means n is divided into n/b at each level.right?and at each level nc work is done..right?so how is that leaves do more or less work?overall work at all the levls will be same.right?? and pls dun call me ma'am..i am also a student like you..;):-P 0 votes 0 votes Akriti sood commented Jan 23, 2017 reply Follow Share MAY be i am getting u now.suppose T(n) =2T(N/2) + n2 then n n2 / \ n/2 n/2 (n/2)2 + (n/2)2 at,next level (n/4)2 + (n/4)2 + (n/4)2 + (n/4)2 hence,at leaves,work done is less. am i right?? thanks jason..:) 0 votes 0 votes Jason GATE commented Jan 23, 2017 reply Follow Share Exactly Ma'am that work will be very less compared to the Work done by the Root. 0 votes 0 votes Please log in or register to add a comment.