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

I forgot my password
All Activity
Questions
Unanswered
Tags
Subjects
Users
Ask
Previous
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
+1
vote
1
answer
1
gate forum
asked
Sep 2
in
Programming
by
nag.swarna
(
81
points)

28
views
recursion
0
votes
1
answer
2
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
in
Programming
by
shivam sharma 5
(
39
points)

48
views
programminginc
recursion
0
votes
0
answers
3
recursion"what is the output of the program"
asked
Aug 27
in
Programming
by
shivam sharma 5
(
39
points)

31
views
recursion
+2
votes
2
answers
4
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
in
Programming
by
rishabhgupta12
(
65
points)

48
views
linkedlists
recursion
+2
votes
2
answers
5
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
in
Programming
by
parasghai28
(
39
points)

120
views
recursion
functions
programminginc
0
votes
1
answer
6
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
in
Programming
by
parasghai28
(
39
points)

161
views
recursion
programminginc
0
votes
1
answer
7
#C Recursion Question (A variance of Gate 2018) Question
asked
Jun 28
in
Programming
by
iarnav
Loyal
(
8.1k
points)

104
views
programminginc
numericalanswers
recursion
0
votes
2
answers
8
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
in
DS
by
eyeamgj
Active
(
4.4k
points)

109
views
datastructure
recursion
stack
0
votes
0
answers
9
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
in
Algorithms
by
kartikeya2812
(
7
points)

80
views
timecomplexity
algorithms
asymptoticnotations
recursion
+4
votes
3
answers
10
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
in
Algorithms
by
bts
(
149
points)

145
views
recursion
timecomplexity
algorithms
mastertheorem
0
votes
1
answer
11
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
in
Algorithms
by
hacker16
Active
(
2.7k
points)

72
views
timecomplexity
recursion
algorithms
0
votes
0
answers
12
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
in
Algorithms
by
hacker16
Active
(
2.7k
points)

81
views
algorithms
recursion
dynamicprogramming
0
votes
1
answer
13
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
in
Programming
by
Moin Mukhtar
(
269
points)

91
views
datastructure
recursion
0
votes
0
answers
14
Printing elements of linkedlist using recursion.
asked
Mar 6
in
Programming
by
Ahsanul Hoque
(
231
points)

103
views
recursion
linkedlists
+6
votes
6
answers
15
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
in
Programming
by
gatecse
Boss
(
18.1k
points)

1.8k
views
gate2018
programminginc
numericalanswers
recursion
0
votes
1
answer
16
recursion
did recursion is bottom up approach to problem solving?
asked
Feb 9
in
Programming
by
kd.....
(
285
points)

73
views
recursion
+3
votes
1
answer
17
ME test series
asked
Jan 28
in
Algorithms
by
sumit chakraborty
Active
(
1.2k
points)

101
views
madeeasytestseries
recurrence
recursion
+4
votes
1
answer
18
made easy test series
asked
Jan 18
in
Programming
by
Abhishek Kumar Singh
Junior
(
959
points)

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

100
views
timecomplexity
algorithms
asymptoticnotations
recursion
+4
votes
0
answers
20
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
in
Algorithms
by
Aakanchha
Junior
(
751
points)

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

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

402
views
algorithms
recurrence
timecomplexity
recursion
+2
votes
0
answers
23
Recursion Stack
My doubt is, In the stack, we will push [main()>PTN(3)>PTN(2)>PTN(1)>PTN(0)] PTN = printTwoNumbers function call Then according to answer PTN(0) won't pushed into stack, but at least to check if and return we should push it. What's the correct. My answer is 5, given is 4
asked
Jan 5
in
DS
by
Ashwin Kulkarni
Boss
(
17.9k
points)

126
views
datastructure
stack
recursion
+2
votes
0
answers
24
Recursion
State which one is true 1) Every left recursive grammar can be converted to right recursive grammar 2) Every right recursive grammar can be converted to left recursive grammar 3) Recursion use static storage
asked
Dec 29, 2017
in
Compiler Design
by
srestha
Veteran
(
96.1k
points)

56
views
recursion
compilerdesign
+3
votes
1
answer
25
C Recursion
asked
Dec 24, 2017
in
Programming
by
Abhishek Kumar Singh
Junior
(
959
points)

127
views
recursion
programminginc
+3
votes
1
answer
26
Time Complexity
T(n) = T(n/2) + 2T(n/5) + T(n/10) + 4n What is the time complexity for the recursion above?
asked
Dec 5, 2017
in
Algorithms
by
Warlock lord
Active
(
3.4k
points)

204
views
timecomplexity
algorithms
asymptoticnotations
recursion
0
votes
0
answers
27
Time Complexity
hope(n){ if (n == 1) G(n) else F() + hope(n/2); } What is the time complexity for the given function, if the function G' and function F' take O(1) and O(n) unit of time respectively. My views: If we take the recursion in the form of "T(n) = T ... being called 'log n' times as well? Why can't the answer be O(nlogn) since F() (whose complexity is O(n)) is called 'log n' times?
asked
Dec 5, 2017
in
Algorithms
by
Warlock lord
Active
(
3.4k
points)

95
views
timecomplexity
algorithms
asymptoticnotations
recursion
0
votes
0
answers
28
[Algorithms] Tower of honoi
Can we solve Towers of honoi with DP? If yes,then what will be time and space complexity?
asked
Nov 26, 2017
in
Algorithms
by
rahul sharma 5
Boss
(
24.7k
points)

96
views
recursion
towersofhanoi
programming
timecomplexity
0
votes
1
answer
29
Recurssion problem.
What will be the output? for foo(4) 4332221234 4332221324 43222214 4332211223
asked
Nov 22, 2017
in
Programming
by
JPranavc
(
281
points)

79
views
recursion
0
votes
1
answer
30
programming
how static affects in this program?
asked
Nov 19, 2017
in
Programming
by
chandra sai
Active
(
1.2k
points)

61
views
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
kvs pgt
Algorithms GO Classroom
Programming and DS GO Classroom
Discrete Mathematics GO Classroom
Digital Logic GO Classroom
Follow @csegate
Gatecse
Recent questions tagged recursion
Recent Blog Comments
@Arjun sir how to remove such post? should i hide...
[email protected]
.Plz do share @Sanjay sharma
Please post it as question
This is blog area post it as question
[email protected]
39,778
questions
46,781
answers
140,752
comments
58,672
users