GATE / CS ARCHIVE

GATE CSE 2021 SET 1 / QUESTION 30

GATE CSE 2021 Set 1 Q30

Algorithms · Asymptotic Analysis & Recurrences · Full GATE CSE 2021 Set 1 paper

GATE 2021 Set 1, Q30 2 marks · MCQ
Report issue

Asymptotic Analysis & Recurrences

Question 30, GATE 2021: The printed recurrence is T(n)=T(n/2)+T(2n/5)+7n for n>0, and T(0)=1. Under the intended integer-rounded or terminating-cutoff interpretation, select its tight order. A Θ(n^(5/2)); B Θ(n log n); C Θ(n); D Θ((log n)^(5/2)). The printed recurrence itself omits a rounding/cutoff convention.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Our answer: C under terminating integer-size recurrence convention

The two recursive subproblem sizes sum to 0.9n. Thus the nonrecursive work over successive levels is bounded by 7n[1+0.9+0.9²+…]=70n. A terminating rounded-size recursion tree has O(n) leaves, so constant leaf costs do not alter the upper bound. The root alone costs 7n, giving Ω(n), hence Θ(n), C. Literal qualification: exact real-valued subproblem sizes never reach 0 from positive n, and the only printed base case is n=0. Integer rounding or a positive-size cutoff is therefore implicit; without such a convention the displayed recursion is not a terminating algorithm.

An induction makes the linear upper bound concrete: for floor-rounded subproblems and n≥1, assume T(k)≤Ck+D for smaller k. Then T(n)≤.9Cn+2D+7n, so any C sufficiently above 70 absorbs the constant excess for large n; enlarge constants for finitely many small cases. Alternatively a positive cutoff and geometric level sum yield the same result. Applying the equal-subproblem Master theorem directly would be invalid because the two recursive sizes differ.

Original paper, page 26 · Answer key