The Gateway to Computer Science Excellence
For all GATE CSE Questions
Toggle navigation
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
Recent questions tagged recursion
0
votes
1
answer
1
Self Doubt:Infinite loop
#include<iostream> using namespace std; int i=0; void a() { i+=1; cout<<i<< ".hello"<<endl; a(); } int main() { a(); } For this above code the output is only upto → 64891.Hello Does this mean that that the stack can hold only 64891 recursive calls? (I am using dev c++)
asked
Jun 2
in
Programming
by
Hirak
Active
(
3.5k
points)

137
views
algorithms
programminginc
recursion
+2
votes
1
answer
2
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)

263
views
programminginc
recursion
+1
vote
0
answers
3
MadeEasy Full Length Test 2019: Programming & DS  Recursion
asked
Jan 12
in
Programming
by
Na462
Loyal
(
6.8k
points)

221
views
programming
recursion
madeeasytestseries
madeeasytestseries2019
+2
votes
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
(
131
points)

175
views
programminginc
programming
recursion
algorithms
+1
vote
2
answers
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
(
2k
points)

657
views
algorithms
recurrence
timecomplexity
recursion
+1
vote
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
(
16.1k
points)

246
views
madeeasytestseries
programming
recursion
+1
vote
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
(
2.4k
points)

184
views
compilerdesign
runtimeenvironments
operatingsystem
memorymanagement
heap
recursion
activationrecords
+1
vote
2
answers
8
Recursion
What is Head recursion and Tail Recursion??
asked
Oct 22, 2018
in
Programming
by
Lakshman Patel RJIT
Veteran
(
54k
points)

92
views
datastructure
recursion
+2
votes
1
answer
9
gate forum
asked
Sep 2, 2018
in
Programming
by
nag.swarna
(
177
points)

78
views
recursion
+1
vote
2
answers
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
(
37
points)

134
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
(
37
points)

177
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
(
57
points)

98
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
(
33
points)

204
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
(
33
points)

260
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
(
8.2k
points)

229
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.1k
points)

387
views
datastructure
recursion
stack
+1
vote
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
(
21
points)

117
views
timecomplexity
algorithms
asymptoticnotations
recursion
+7
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
(
123
points)

249
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.7k
points)

88
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.7k
points)

135
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
(
253
points)

152
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
(
195
points)

120
views
recursion
linkedlists
+9
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
(
16.7k
points)

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

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

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

217
views
programming
recursion
madeeasytestseries
+5
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
(
35.4k
points)

123
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
(
655
points)

176
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
(
87
points)

1.3k
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
(
87
points)

861
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
OFFICIAL GATE MOCK TEST RELEASED
IIITH: Winter Research Admissions 2019 (For Spring 2020)
TIFR and JEST exam
Minimal Deterministic Finite Automata
To be aware of fake GATE test series
Follow @csegate
Recent questions tagged recursion
Recent Blog Comments
Sir can you please suggest some way like how can...
I think it's been refactored...
@ankitgupta.1729 options after JEST for...
@ankitgupta.1729 @arjun sir There is no...
@ankitgupta.1729 IISc accepts only...
50,651
questions
56,214
answers
194,170
comments
95,420
users