Skip to content
Early access — you're among the first to try PYQLabs. Share feedback
Concept drill

recurrence-relation

GATE CSE & IT · Complexity Theory · 1987-2026

58
PYQs
83%
keyed
14
elite explanations
29
years appeared

Study anchor

Cormen et al. — Introduction to Algorithms (CLRS)

Algorithms, data structures, graph algorithms, complexity

Practice action

Start latest PYQ

PYQs in this concept

All concepts →
2026 PYQ

Consider the following recurrence relations: For all $n>1$, $$ \begin{aligned} & T_1(n)=4 T_1\left(\frac{n}{2}\right)+T_2(n) \\ & T_2(n)=5 T_2\left(\frac{n}{4}\right)+\theta\left(\...

mediumanswer keyelite explanation
2026 PYQ

Which of the following can be recurrence relation(s) corresponding to an algorithm with time complexity $\Theta(n)$ ?

easyanswer keyelite explanation
2025 Q8

Which one of the following options is correct for the given data in the table?

mediumanswer key
2025 Q20

Consider the following recurrence relation: T(n) = 2T(n - 1) + n2^n for n > 0, T(0) = 1. Which ONE of the following options is CORRECT?

mediumanswer key
2025 PYQ

Consider the following recurrence relation : $$T(n)=2 T(n-1)+n 2^n \text { for } n>0, T(0)=1$$ Which ONE of the following options is CORRECT?

mediumanswer keyelite explanation
2025 PYQ

Which one of the following options is correct for the given data in the table? Iteration ($i$) 0 1 2 3 Input ($I$) 20 $-$4 10 15 Output ($X$) 20 16 26 41 Output ($Y$) 20 $-$80 $-$8...

easyanswer keybasic explanation
2024 Q15

Let T(n) be the recurrence relation defined as follows: T(0) = 1, T(1) = 2, and T(n) = 5T(n - 1) – 6T(n-2) for n ≥ 2 Which one of the following statements is TRUE?

mediumanswer key
2024 Q42

Consider the following recurrence relation: $T(n) = \begin{cases} \sqrt{n}T(\sqrt{n}) + n & \text{for } n \geq 1, \\ 1 & \text{for } n = 1. \end{cases}$ Which one of the following...

mediumanswer key
2024 PYQ

Consider the following recurrence relation: $$T(n) = \begin{cases} \sqrt{n} T(\sqrt{n}) + n & \text{for } n \ge 1, \\ 1 & \text{for } n = 1. \end{cases}$$ Which one of the followin...

mediumanswer keyelite explanation
2024 PYQ

Consider the following C function definition. int f(int x, int y) { for (int i=0; i<y; i++) { x=x+x+y; } return x; } Which of the following statements is/are TRUE about the above f...

mediumanswer keyelite explanation
2024 PYQ

Let $T(n)$ be the recurrence relation defined as follows: $T(0) = 1$ $T(1) = 2$, and $T(n) = 5T(n - 1) - 6T(n - 2)$ for $n \geq 2$ Which one of the following statements is TRUE?

mediumanswer keybasic explanation
2023 PYQ

A series of natural numbers $$F_1,F_2,F_3,F_4,F_5,F_6,F_7,\,.....$$ obeys $$F_{n+1}=F_n+F_{n-1}$$ for all integers $$n\ge2$$. If $$F_6=37$$, and $$F_7=60$$, then what is $$F_1$$ ?

easyanswer keybasic explanation
2023 PYQ

The Lucas sequence $$L_n$$ is defined by the recurrence relation: $${L_n} = {L_{n - 1}} + {L_{n - 2}}$$, for $$n \ge 3$$, with $${L_1} = 1$$ and $${L_2} = 3$$. Which one of the opt...

easyanswer keybasic explanation
2022 PYQ

Consider the following recurrence : f(1) = 1; f(2n) = 2f(n) $$-$$ 1, for n $$\ge$$ 1; f(2n + 1) = 2f(n) + 1, for n $$\ge$$ 1; Then, which of the following statements is/are TRUE?

mediumanswer keybasic explanation
2021 PYQ

For constants a ≥ 1 and b > 1, consider the following recurrence defined on the non-negative integers : $$T\left( n \right) = a.T\left( {\frac{n}{b}} \right) + f\left( n \right)$$...

easyanswer keyelite explanation
2021 PYQ

Consider the following recurrence relation. $$T(n) = \left\{ {\begin{array}{*{20}{c}} {T(n/2) + T(2n/5) + 7n \ \ \ if\ n > 0}\\ {1\ \ \ \ \ \ \ if\ n = 0} \end{array}} \right.$$ Wh...

mediumanswer keyelite explanation
2020 PYQ

For parameters a and b, both of which are $$\omega \left( 1 \right)$$, T(n) = $$T\left( {{n^{1/a}}} \right) + 1$$, and T(b) = 1. Then T(n) is

mediumanswer keyelite explanation
2017 Q30

Consider the recurrence function T(n) = { 2T(√n) + 1, n > 2; 2, 0 < n ≤ 2. Then T(n) in terms of Θ notation is

mediumanswer key
2016 PYQ

Consider the recurrence relation $${a_1} = 8,\,{a_n} = 6{n^2} + 2n + {a_{n - 1}}.$$ Let $${a_{99}} = K \times {10^4}.$$ The value of $$K$$ is ____________.

medium
2016 PYQ

Let $${a_n}$$ be the number of $$n$$-bit strings that do NOT contain two consecutive $$1s.$$ Which one of the following is the recurrence relation for $${a_n}$$?

easyanswer key
2015 PYQ

Which one of the following is the recurrence equation for the worst case time complexity of the Quicksort algorithm for sorting n ( $$ \ge 2$$ ) numbers? In the recurrence equation...

easyanswer key
2015 PYQ

Let $${a_n}$$ represent the number of bit strings of length n containing two consecutive 1s. What is the recurrence relation for $${a_n}$$?

mediumanswer key
2014 PYQ

A pennant is a sequence of numbers, each number being 1 or 2. An n-pennant is a sequence of numbers with sum equal to n. For example, (1,1,2) is a 4-pennant. The set of all possibl...

medium
2014 PYQ

Suppose you want to move from 0 to 100 on the number line. In each step, you either move right by a unit distance or you take a shortcut. A shortcut is simply a pre specified pair...

easy
2014 PYQ

Which one of the following correctly determines the solution of the recurrence relation with T(1) = 1? T(1) = 2T (n/2) + log n

easyanswer key
2012 PYQ

The recurrence relation capturing the optional execution time of the Towers of Hanoi problem with $$n$$ discs is

easyanswer key
2011 PYQ

An algorithm to find the length of the longest monotonically increasing sequence of numbers in an array A[0:n−1] is given below. Let L i , denote the length of the longest monotoni...

easyanswer key
2011 PYQ

Consider a database table T containing two columns X and Y each of type integer. After the creation of the table, one record (X = 1, Y = 1) is inserted in the table. Let MX and MY...

easyanswer key
2009 PYQ

A sub-sequence of a given sequence is just the given sequence with some elements (possibly none or all) left out. We are given two sequences X[m] and Y[n] of lengths m and n, respe...

easyanswer key
2009 PYQ

In quick sort, for sorting n elements, the (n/4)th smallest element is selected as pivot using an O(n) time algorithm. What is the worst case time complexity of the quick sort?

mediumanswer key
2009 PYQ

The running time of an algorithm is represented by the following recurrence relation: $$T(n) = \begin{cases} n & n \leq 3 \\ T(\frac{n}{3})+cn & \text{ otherwise } \end{cases}$$ Wh...

easyanswer key
2008 PYQ

Let $${x_n}$$ denote the number of binary strings of length $$n$$ that contains no consecutive $$0s$$. Which of the following recurrences does $${x_n}$$ satisfy?

mediumanswer key
2008 PYQ

Consider the Quicksort algorithm. Suppose there is a procedure for finding a pivot element which splits the list into two sub-lists each of which contains at least one-fifth of the...

mediumanswer key
2008 PYQ

When $$n = {2^{2k}}$$ for some $$k \ge 0$$, the recurrence relation $$$T\left( n \right) = \sqrt 2 T\left( {n/2} \right) + \sqrt n ,\,\,T\left( 1 \right) = 1$$$ evaluates to

mediumanswer key
2008 PYQ

The subset-sum problem is defined as follows. Given a set of n positive integers, S = {a 1 ,a 2 ,a 3 ,…,a n } and positive integer W, is there a subset of S whose elements sum to W...

mediumanswer key
2008 PYQ

Let $${x_n}$$ denote the number of binary strings of length $$n$$ that contain no consecutive $$0s$$. The value of $${x_5}$$ is

easyanswer key
2007 PYQ

What is the time complexity of the following recursive function? int DoSomething(int n){ if(n <= 2) return 1; else return (floor(sqrt(n)) + n); }

mediumanswer keyelite explanation
2006 PYQ

The median of n elements can be found in O(n) time. Which one of the following is correct about the complexity of quick sort, in which median is selected as pivot?

easyanswer key
2006 PYQ

Consider the following recurrence: $$T\left( n \right){\rm{ }} = {\rm{ 2T(}}\left\lceil {\sqrt n } \right\rceil {\rm{) + }}\,{\rm{1 T(1) = 1}}$$ Which one of the following is true?

mediumanswer key
2005 PYQ

In a binary tree, for every node the difference between the number of nodes in the left and right subtrees is at most 2. If the height of the tree is h > 0, then the minimum number...

mediumanswer key
2004 PYQ

A program takes as input a balanced binary search tree with n leaf nodes and computes the value of a function g(x) for each node x. If the cost of computing g(x) is min{ no. of lea...

mediumanswer key
2004 PYQ

The time complexity of the following C function is (assume n > 0) int recursive(int n){ if(n == 1){ return (1); } return (recursive(n - 1) + recursive(n - 1)); }

easyanswer keyelite explanation
2004 PYQ

The recurrence equation T(1) = 1 T(n) = 2T(n - 1)+n, $$n \ge 2$$ Evaluates to

mediumanswer keyelite explanation
2004 PYQ

The recurrence equation $$\,\,\,\,\,\,\,T\left( 1 \right) = 1$$ $$\,\,\,\,\,\,T\left( n \right) = 2T\left( {n - 1} \right) + n,\,n \ge 2$$ evaluates to

mediumanswer key
2002 PYQ

The running time of the following algorithm Procedure A(n) If n<=2 return (1) else return (A([$$\sqrt n $$])); is best described by

mediumanswer keyelite explanation
2002 PYQ

The solution to the recurrence equation T(2 k ) = 3 T(2 k-1 ) + 1, T (1) = 1, is:

mediumanswer key
2001 PYQ

Consider the following C program: void abc(char *s) { if(s[0]=='\0') return; abc(s+1); abc(s+1); printf("%c",s[0]); } main() { abc("123"); } (a) What will be the output of the prog...

medium
2000 PYQ

The solution to the recurrence equation $$T\left( {{2^k}} \right)$$ $$ = 3T\left( {{2^{k - 1}}} \right) + 1$$, $$T\left( 1 \right) = 1$$ is:

mediumanswer key
1998 PYQ

Solve the following recurrence relation $$\,\,\,\,\,\,\,{x_n} = 2{x_{n - 1}} - 1\,\,n > 1$$ $$\,\,\,\,\,\,\,{x_1} = 2$$

easy
1997 PYQ

Let T(n) be the function defined by $$T(1) =1, \: T(n) = 2T (\lfloor \frac{n}{2} \rfloor ) + \sqrt{n}$$ Which of the following statements is true?

easyanswer key
1996 PYQ

The recurrence relation $$\,\,\,\,\,$$ $$T\left( 1 \right) = 2$$ $$T\left( n \right) = 3T\left( {{n \over 4}} \right) + n$$ has the solution $$T(n)$$ equal to

easyanswer key
1996 PYQ

The recurrence relation T(1) = 2 T(n) = 3T(n/4) + n has the solution, T(n) equals to

easyanswer key
1994 PYQ

The recurrence relation that arises in relation with the complexity of binary search is:

easyanswer key
1990 PYQ

Express T(n) in terms of the harmonic number H n = $$\sum\limits_{t = 1}^n {1/i,n \ge 1} $$ where T(n) satisfies the recurrence relation, T(n) = $${{n + 1} \over 2}$$ T(n-1) + 1, f...

hardelite explanation
1988 PYQ

Solve the recurrence equations: $$\,\,\,\,\,\,\,\,\,\,T\left( n \right) = \left( {{n \over 2}} \right) + 1$$ $$\,\,\,\,\,\,\,\,\,\,\,T\left( 1 \right) = 1$$

easy
1987 PYQ

Find a solution to the following recurrence equation T(n) = T(n - 1)+ n T(1) = 1

easy
1987 PYQ

Solve the recurrence equations T (n) = T (n - 1) + n T (1) = 1

easyelite explanation
1987 PYQ

(a) Solve the recurrence equations $$\,\,\,\,\,\,\,\,\,T\left( n \right) = T\left( {n - 1} \right) + n$$ $$\,\,\,\,\,\,\,\,\,T\left( 1 \right) = 1T$$ (b) What is the generating fun...

medium