Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Webpage
Programming in C.
Recursion.
Filter
Recent
Hot!
Most votes
Most answers
Most views
Previous GATE
Featured
Most answered questions in Programming and DS
1
votes
1
answer
3481
The order in which operands are evaluated in an expression is predictable
The order in which operands are evaluated in an expression is predictable if the operator is a) * b) + c) % d) &&
The order in which operands are evaluated in an expression is predictable if the operator isa) * b) + c) % d) &&
Imarati Gupta
13.6k
views
Imarati Gupta
asked
Jan 1, 2017
0
votes
1
answer
3482
insert_front_linkedlist
Vaishali Trivedi
278
views
Vaishali Trivedi
asked
Jan 1, 2017
0
votes
1
answer
3483
programming and ds
Given an algorithm: void preorder(tree *t) { if(t) { 1. if(t->data==NULL) return ; else printf(t->data); 2. preorder(t->left); 3. preorder(t->right); } } Find the number of function calls made for traversing for preorder following above algorithm,for th below given tree; A / \ B C / \ D E \ / F G
Given an algorithm:void preorder(tree *t){if(t){1. if(t->data==NULL)return ;else printf(t->data);2. preorder(t->left);3. preorder(t->right); }}Find the number of function...
deepak_yadav
269
views
deepak_yadav
asked
Jan 1, 2017
0
votes
1
answer
3484
Gate 2006
If pointer to leaf node of max heap given, what is the time complexity to find smallest element?
If pointer to leaf node of max heap given, what is the time complexity to find smallest element?
Adiaspirant
258
views
Adiaspirant
asked
Jan 1, 2017
7
votes
1
answer
3485
Recursion
Consider the following recursive function which is used by dynamic programming. Assume for every function call T(i) it checks the table first, if its value is already computed it retrieves the value from table. Otherwise it calls a recursive function call to ... number of function calls that need the support of stack to complete the execution of the function T(12) are __________ .
Consider the following recursive function which is used by dynamic programming.Assume for every function call T(i) it checks the table first, if its value is already comp...
Anirban Biswas
1.4k
views
Anirban Biswas
asked
Dec 31, 2016
1
votes
1
answer
3486
What is the result of expression 5.45 + "3.2"
What is the result of expression 5.45 + "3.2"? (a) The double value 8.6 (b) The string ""8.6" (c) The long value 8. (d) The String "5.453.2"
What is the result of expression 5.45 +"3.2"?(a) The double value 8.6 (b) The string ""8.6"(c) The long value 8. (d) The String "5.453.2"
Sanjay Sharma
2.4k
views
Sanjay Sharma
asked
Dec 31, 2016
0
votes
1
answer
3487
ACE-TEST
reena_kandari
243
views
reena_kandari
asked
Dec 31, 2016
0
votes
1
answer
3488
output of program
Predict the output of following code segment: #include<iostream.h> Void main ( ) { int x { } = {1,2,3,4,5}; int *p,**q,*t; p=x; cout<<*p; t=x+2; q=&t; cout<<*++p <<**q <<**q <<*t;} (a) 1233 (b) 1223 (d) 1234 (d) 2345
Predict the output of following code segment: #include<iostream.h Void main ( ) { int x { } = {1,2,3,4,5}; int *p, q,*t; p=x; cout<<*p; t=x+2; q=&t; cout<<*++p << q << q ...
Sanjay Sharma
755
views
Sanjay Sharma
asked
Dec 30, 2016
3
votes
1
answer
3489
DFS using Stack
Could someone please explain Depth first Search using Stack? I have found different algorithms for handling the visited flag and the way the nodes are pushed. I am having problems in solving these types of questions - Find the nodes or number of nodes that are pushed onto stack more than once? Could someone please help with a small example?
Could someone please explain Depth first Search using Stack? I have found different algorithms for handling the visited flag and the way the nodes are pushed. I am havi...
yg92
2.7k
views
yg92
asked
Dec 30, 2016
DS
data-structures
stack
descriptive
+
–
2
votes
1
answer
3490
C programming
#define Raining 0x04 int bring_flower(unsigned u) { return (u & Raining == 0) ? 0 : 1; } int main() { printf("%d\n",bring_flower(0x1B)); return 0; } Above program $\rightarrow$ Always returns 0 0 when the Third rightmost bit of the input to bring_flower is 0 1 when the Third rightmost bit of the input to bring_flower is 1 Always returns 1
#define Raining 0x04 int bring_flower(unsigned u) { return (u & Raining == 0) ? 0 : 1; } int main() { printf("%d\n",bring_flower(0x1B)); return 0; }Above program $\righta...
dd
331
views
dd
asked
Dec 29, 2016
Programming in C
programming-in-c
output
+
–
0
votes
1
answer
3491
Minheap
monty
829
views
monty
asked
Dec 29, 2016
DS
data-structures
binary-heap
time-complexity
+
–
3
votes
1
answer
3492
C programming
#include <stdio.h> void A() { printf("A");}; void B() { printf("B");}; void C() { printf("C");}; void D() { printf("D");}; int main() { void (*P[4])() = {A,B,C,D}; for(int i=0;i<4;i++) (*(i+P))(); }
#include <stdio.h void A() { printf("A");}; void B() { printf("B");}; void C() { printf("C");}; void D() { printf("D");}; int main() { void (*P[4])() = {A,B,C,D}; for(int...
dd
316
views
dd
asked
Dec 28, 2016
Programming in C
programming-in-c
output
+
–
2
votes
1
answer
3493
C programming
#include <stdio.h> int foo(unsigned word) { int n = 0; int num_set_bits[16] = {0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4}; while( word > 0 ) { n += num_set_bits[ word & 0xF ]; word >>= 4; } return n; } int main() { printf("%d\n",foo(0xABC)); return 0; } Output of the above program ?
#include <stdio.h int foo(unsigned word) { int n = 0; int num_set_bits[16] = {0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4}; while( word 0 ) { n += num_set_bits[ word & 0xF ]; word >...
dd
515
views
dd
asked
Dec 28, 2016
Programming in C
programming-in-c
output
pointers
+
–
4
votes
1
answer
3494
find the output
main () { if(--i) { main (); printf("%d", i); } } 5 4 3 2 1 1 2 3 4 5 0 0 0 0 0 Compiler error
main () { if( i) { main (); printf("%d", i); } } 5 4 3 2 1 1 2 3 4 5 0 0 0 0 0 Compiler error
Akriti sood
1.3k
views
Akriti sood
asked
Dec 28, 2016
Programming in C
programming-in-c
data-structures
+
–
0
votes
1
answer
3495
find the output
Consider the following C program: int fun(int p, int*q) { int n; *q+=5; n=*q; p=p+n; return(p+n); } main() { int i=0, *p, y; p=&i; y=fun(i, p); printf("%d", y); } The output of the above program is ________. 5 10 15 ---------- ... to 5,it should stay 0 only. now next statement p=p+n means p=0 +5=5 now,return statement (p+n) returns (5+5) =10 am i correct or not??
Consider the following C program:int fun(int p, int*q){int n;*q+=5;n=*q;p=p+n;return(p+n);}main(){int i=0, *p, y;p=&i;y=fun(i, p);printf("%d", y);}The output of the above...
Akriti sood
561
views
Akriti sood
asked
Dec 28, 2016
Programming in C
programming-in-c
+
–
7
votes
1
answer
3496
TIFR CSE 2016 | Part B | Question: 5
Consider the recursive function $\mathsf{mc91}$ ... $\{ n: 0 \leq n \leq 110 \}$ $\{ n: 0 \leq n \leq 111 \}$ $\{ n: 0 \leq n < + \infty \}$
Consider the recursive function $\mathsf{mc91}$.int mc91(int n) { print n if (n 100) { return n-10; } else { return mc91(mc91(n+11)); } }Let $\mathsf{Out}=\{n : \text{ t...
go_editor
655
views
go_editor
asked
Dec 28, 2016
Programming in C
tifr2016
programming-in-c
recursion
+
–
1
votes
1
answer
3497
Static Variable C Initialization
Why am i not getting any error while executing the following statements? int x=20; int z=x;//error expected but not coming int main() { int y=10; static int temp=y; //Error expected but not coming temp=99;//Error expected but not coming getch(); }
Why am i not getting any error while executing the following statements?int x=20;int z=x;//error expected but not comingint main(){int y=10;static int temp=y; //Error exp...
rahul sharma 5
1.1k
views
rahul sharma 5
asked
Dec 28, 2016
Programming in C
programming-in-c
output
static-single-assignment
+
–
0
votes
1
answer
3498
C Program Output
How is the"do" function working here? What will be the output?
How is the"do" function working here? What will be the output?
Samujjal Das
966
views
Samujjal Das
asked
Dec 27, 2016
1
votes
1
answer
3499
C programming
int main() { int a, b; /* Some code which initializes "a" here ... */ if (a < 0) { a = -a; } b = sqrt (a); } Above code will always work for calculating the square root of any valid integer value on a system . [T/F]
int main() { int a, b; /* Some code which initializes "a" here ... */ if (a < 0) { a = -a; } b = sqrt (a); }Above code will always work for calculating the square root of...
dd
1.1k
views
dd
asked
Dec 26, 2016
Programming in C
programming-in-c
+
–
3
votes
1
answer
3500
Consider an array ‘A’ with 2m elements. The elements in odd position are sorted in non-increasing order that
Consider an array ‘A’ with 2m elements. The elements in odd position are sorted in non-increasing order that is A >= A[3] >= A[5]......A[2m-1] The elements in even p...
Akriti sood
1.0k
views
Akriti sood
asked
Dec 26, 2016
DS
algorithms
sorting
graph-theory
+
–
Page:
« prev
1
...
170
171
172
173
174
175
176
177
178
179
180
...
310
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register