The Gateway to Computer Science Excellence
For all GATE CSE Questions
Toggle navigation
GATE Overflow
Facebook Login
or
Email or Username
Password
Remember
Login
Register

I forgot my password
Activity
Questions
Unanswered
Tags
Subjects
Users
Ask
Prev
Blogs
New Blog
Exams
First time here? Checkout the
FAQ
!
x
×
Close
Use the google search bar on side panel. It searches through all previous GATE/other questions. For hardcopy of previous year questions please see
here
Recent questions tagged recursion
0
votes
1
answer
1
ME MOCK 4
Consider the following function: void madeeasy (int n) { if (n < 0) return; else { printf(n); madeeasy ( n); madeeasy (n  ); printf(n); } } The sum of all values printed by madeeasy (5)_______ (I am getting 12 but given answer is 52)
asked
Jan 30
in
Programming
by
newdreamz a1z0
Active
(
1.6k
points)

162
views
programminginc
recursion
0
votes
0
answers
2
MadeEasy Full Length Test 2019: Programming & DS  Recursion
asked
Jan 12
in
Programming
by
Na462
Loyal
(
8.7k
points)

115
views
programming
recursion
madeeasytestseries
madeeasytestseries2019
0
votes
0
answers
3
GATEBOOK2019 Grand Test DS&A25
int foo(int a, int b) { if (a%b == 0) return b; else return foo(b, a%b); } What is the output given by $foo(17, 3)$? $3$ $17$ $51$ $1$
asked
Jan 6
in
Algorithms
by
GATEBOOK
Boss
(
15.3k
points)

43
views
gb2019gtdsa
recursion
+1
vote
1
answer
4
output of the program
#include <stdio.h> void print(int n, int j) { if (j >= n) return; if (nj > 0 && nj >= j) printf("%d %dn", j, nj); print(n, j+1); } int main() { int n = 8; print(n, 1); } (A) 1 7 2 6 3 5 4 4 4 4 (B) 1 7 2 6 3 5 4 4 (C) 1 7 2 6 3 5 (D) 1 2 3 4 5 6 7 8 Answer is B. anyone can explain how?
asked
Dec 11, 2018
in
Algorithms
by
Gangani_Son
(
163
points)

82
views
programminginc
programming
recursion
algorithms
0
votes
1
answer
5
T(n) = sqrt(n) * T(sqrt(n)) + n
T(n) = sqrt(n) * T(sqrt(n)) + n Given solution is O(log log n). But my solution is O(n log log n). 'wolframalpha'' shows the answer same as mine. You can find the solution here. Can anyone confirm the solution and provide an explantion?
asked
Nov 22, 2018
in
Algorithms
by
gmrishikumar
Active
(
1.7k
points)

252
views
algorithms
recurrence
timecomplexity
recursion
0
votes
1
answer
6
MadeEasy Test Series: Programming & DS  Programming
The answer given is 27. I am getting 34. Please verify.
asked
Nov 21, 2018
in
Programming
by
Soumya29
Boss
(
15.3k
points)

175
views
madeeasytestseries
programming
recursion
0
votes
1
answer
7
Runtime Environment Heap Allocation
Does Heap Allocation support both recursion and dynamic memory allocation? Because,a stack can be implemented using dynamic memory allocation.Please correct me. Test Series answer shows only dynamic memory allocation
asked
Nov 3, 2018
in
Compiler Design
by
sripo
Active
(
1.5k
points)

114
views
compilerdesign
runtimeenvironments
operatingsystem
memorymanagement
heap
recursion
activationrecords
0
votes
2
answers
8
Recursion
What is Head recursion and Tail Recursion??
asked
Oct 22, 2018
in
Programming
by
Lakshman Patel RJIT
Boss
(
29.4k
points)

55
views
datastructure
recursion
+1
vote
1
answer
9
gate forum
asked
Sep 2, 2018
in
Programming
by
nag.swarna
(
235
points)

58
views
recursion
0
votes
1
answer
10
pseudo code
int zap(int n) { if (n<=1) then zap =1; else zap = zap(n3)+zap(n1); } then the call zap(6) gives the values of zap Give the proper explanation
asked
Aug 28, 2018
in
Programming
by
shivam sharma 5
(
39
points)

91
views
programminginc
recursion
0
votes
0
answers
11
recursion"what is the output of the program"
#include <stdio.h> void fun(int); typedef int (*pf) (int ,int ); int proc(pf, int ,int); int main() { int a = 3; fun(a); return 0; } void fun(int n) { if (n>0) { fun(n); printf("%d,", n); fun(n); } }
asked
Aug 27, 2018
in
Programming
by
shivam sharma 5
(
39
points)

88
views
recursion
+2
votes
2
answers
12
Linked list
How to trace the below program? p and q are the starting address of two different linked list struct node*Do(struct node*p,struct node*q){ struct node*ps,*qs; if(!p){ return(q); } else if(!q){ return(p); } else{ ps=p>link; qs=q>link; p>link=q; q>link=Do(ps,qs); return(p); } }
asked
Aug 3, 2018
in
Programming
by
rishabhgupta12
(
71
points)

74
views
linkedlists
recursion
+2
votes
2
answers
13
Recursion
int f (int n){ if (n==0) return 0; if(n==1) return 1; else return f(n1)+f(n2); } Find the upper bound and lower bound to the number of function calls for input size 'n'?
asked
Jul 8, 2018
in
Programming
by
parasghai28
(
39
points)

160
views
recursion
functions
programminginc
0
votes
1
answer
14
Recursion
void ab() { auto int a; static int s= 5; a = ++s; printf("%d%d",a,s); if(a<= 7) ab(); printf("%d%d",a,s); } void main() { ab(); } According to me answer should be 667788887766 but the answer is  667788887868. Please explain
asked
Jul 8, 2018
in
Programming
by
parasghai28
(
39
points)

205
views
recursion
programminginc
0
votes
1
answer
15
#C Recursion Question (A variance of Gate 2018) Question
Consider the following program written in pseudocode. Assume that x and y are integers. Count (x, y) { if (y !=2 ) { if (x !=1) { print("*"); Count (x/2, y); } else { y=y1; Count (1024, y); } } } The number of times that ... ================================== My answer is 10220 and I just need someone to verify if it's correct.
asked
Jun 28, 2018
in
Programming
by
iarnav
Loyal
(
9.6k
points)

178
views
programminginc
numericalanswers
recursion
0
votes
2
answers
16
data structure
To remove recursion from a program we have to use which of the following data structure? array stack queue list
asked
Jun 18, 2018
in
DS
by
eyeamgj
Loyal
(
6.7k
points)

249
views
datastructure
recursion
stack
0
votes
0
answers
17
Time Complexity
What will be the time complexity of the following algorithm ? A(n){ if(n<=1) return 1; for(i=1;i<n;i++){ for(j=0;j<3;j++){ A(n1) } } }
asked
Jun 17, 2018
in
Algorithms
by
kartikeya2812
(
7
points)

101
views
timecomplexity
algorithms
asymptoticnotations
recursion
+5
votes
3
answers
18
Time complexity , Recursion
Why is recursive equation of following code $T(n)=T(n/2)+O(1)$, not $T(n)=8*T(n/2)+O(1)$? int x=0; int A(n) { if(n==1) return 1; else { X+=8A(n/2)+n^3; } return X; }
asked
May 29, 2018
in
Algorithms
by
bts
(
149
points)

194
views
recursion
timecomplexity
algorithms
mastertheorem
0
votes
1
answer
19
Time Complexity
int lcs_length(char * A, char * B) { if (*A == '\0'  *B == '\0') return 0; else if (*A == *B) return 1 + lcs_length(A+1, B+1); else return max(lcs_length(A+1,B), lcs_length(A,B+1)); } what is worst case time complexity of $\text{lcs_length}$ if size of $A$ is $m$ and size of $B$ is $n$? O($2^{m+n}$) O($2^{n}$) O($2^{mn}$) O($2^{max(m,n)}$) none of these
asked
Apr 28, 2018
in
Algorithms
by
hacker16
Active
(
2.8k
points)

82
views
timecomplexity
recursion
algorithms
0
votes
0
answers
20
Recursion Tree
What is the max height of recursion tree of recurrence $c(100,50)$? here, the recursive function is defined as $c(n,k) = c(n1,k1) + c(n,k1)$ terminating condition $c(n,n) = 1, c(n,0) = 1$.
asked
Apr 28, 2018
in
Algorithms
by
hacker16
Active
(
2.8k
points)

106
views
algorithms
recursion
dynamicprogramming
0
votes
1
answer
21
SAnfoundary
What data structure would you most likely see in a nonrecursive implementation of a recursive algorithm? Linked List Stack Queue Tree please explain also
asked
Mar 23, 2018
in
Programming
by
Moin Mukhtar
(
275
points)

105
views
datastructure
recursion
0
votes
0
answers
22
Printing elements of linkedlist using recursion.
Can anyone check this program? I got some warning. #include<stdio.h> #include<stdlib.h> void func(struct node *); struct node { int data; struct node *next; }; int main() { struct node *head=(struct node *)malloc(sizeof(struct node)); ... void func(struct node *p) { if(p) { printf("\n%d",p>data); func(p>next); } }
asked
Mar 6, 2018
in
Programming
by
Ahsanul Hoque
(
253
points)

108
views
recursion
linkedlists
+7
votes
6
answers
23
GATE201821
Consider the following $\text{C}$ program: #include<stdio.h> int counter=0; int calc (int a, int b) { int c; counter++; if(b==3) return (a*a*a); else { c = calc(a, b/3); return (c*c*c); } } int main() { calc(4, 81); printf("%d", counter); } The output of this program is ______.
asked
Feb 14, 2018
in
Programming
by
gatecse
Boss
(
18.3k
points)

2.5k
views
gate2018
programminginc
numericalanswers
recursion
0
votes
1
answer
24
recursion
did recursion is bottom up approach to problem solving?
asked
Feb 9, 2018
in
Programming
by
kd.....
Junior
(
851
points)

86
views
recursion
+3
votes
1
answer
25
MadeEasy Test Series 2018: Programming & DS  Recursion
asked
Jan 28, 2018
in
Algorithms
by
sumit chakraborty
Active
(
1.3k
points)

127
views
programming
recursion
madeeasytestseries
+4
votes
1
answer
26
MadeEasy Test Series 2018: Programming & DS  Recursion
asked
Jan 18, 2018
in
Programming
by
Abhishek Kumar Singh
Junior
(
969
points)

187
views
programming
recursion
madeeasytestseries
+4
votes
0
answers
27
Time Complexity
T(n) $\leq$ T($\frac{n}{5}$) + T($\frac{7n}{10}$) + 15n T(n) $\leq$ 5 when n $<$ 6
asked
Jan 9, 2018
in
Algorithms
by
Mk Utkarsh
Boss
(
34.2k
points)

110
views
timecomplexity
algorithms
asymptoticnotations
recursion
+4
votes
0
answers
28
Recurrence equation
What is the highest upper bound time complexity for the following recurrence equation: $T(n)=4T\left ( \frac{n}{2} \right ) +n^{2}2^{\frac{1}{2}}$
asked
Jan 8, 2018
in
Algorithms
by
Aakanchha
Junior
(
761
points)

145
views
algorithms
timecomplexity
recurrence
recursion
+7
votes
1
answer
29
T(n) = T(n/4) + T(3n/4) +n
How to solve above recurrence relation (With substitution method)??
asked
Jan 8, 2018
in
Algorithms
by
anoop yadav 2
(
113
points)

836
views
algorithms
mastertheorem
recurrence
timecomplexity
recursion
+4
votes
2
answers
30
t(n) = sqrt(2) t(n/2) + sqrt(n)
How to solve above recurrence relation?
asked
Jan 7, 2018
in
Algorithms
by
anoop yadav 2
(
113
points)

657
views
algorithms
recurrence
timecomplexity
recursion
Page:
1
2
3
4
next »
Quick search syntax
tags
tag:apple
author
user:martin
title
title:apple
content
content:apple
exclude
tag:apple
force match
+apple
views
views:100
score
score:10
answers
answers:2
is accepted
isaccepted:true
is closed
isclosed:true
Recent Posts
IIT Gandhinagar review
Is DAIICT good for doing MTech ?
AIR175 : GO is enough
GATE 2019 My reasoned routine. (AIR 558)
if i can you also can
Follow @csegate
Recent questions tagged recursion
Recent Blog Comments
congrats man!!! u surely need guts to leave job...
You won't get M.Tech degree then
I have generic query , not just about iit gn but...
Thank you Abhishek
Heartliest Congratulation Abhishek Bhai. This was...
48,515
questions
52,763
answers
183,377
comments
68,234
users