Skip to content
GATEiit

GATE CSE 2021 Set 1 Q40: Solve T(n) = T(n/2) + T(2n/5) + 7n

Question

Consider the following recurrence relation.

T(n)={T(n/2)+T(2n/5)+7nif n>01if n=0T(n) = \begin{cases} T(n/2) + T(2n/5) + 7n & \text{if } n > 0 \\ 1 & \text{if } n = 0 \end{cases}

Which one of the following options is correct?

Try it: multiple choice: exactly one correct option

Select one option
Wrong answer costs 2/3 mark in GATE.
Show answer and explanation

Answer: C (official GATE 2021 final answer key)

Concept used: In a recursion tree whose subproblem fractions sum to less than 1, the work per level shrinks geometrically.

First step: Since 12+25=910<1\frac{1}{2} + \frac{2}{5} = \frac{9}{10} < 1, level ii of the tree costs 7n(0.9)i7n(0.9)^i; sum the series.

Full step-by-step solution

Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.

Share this question

WhatsAppDownload image

Source: official GATE 2021 Set 1 CS question paper and final answer key, organised by IIT Bombay. Question paper · Answer key