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
Recent questions in Programming and DS
0
votes
1
answer
5181
what will be the recurance relation of the following program??
Jay Singh
426
views
Jay Singh
asked
Dec 8, 2015
1
votes
1
answer
5182
time complexity
Jay Singh
701
views
Jay Singh
asked
Dec 7, 2015
43
votes
4
answers
5183
TIFR CSE 2015 | Part B | Question: 4
First, consider the tree on the left. On the right, the nine nodes of the tree have been assigned numbers from the set $\left\{1, 2,\ldots,9\right\}$ so that for every node, the numbers in its left subtree and right subtree lie in disjoint intervals (that is, all numbers in one subtree ... $2^{4}.3^{2}.5.9=6480$ $2^{3}.3.5.9=1080$ $2^{4}=16$ $2^{3}.3^{3}=216$
First, consider the tree on the left. On the right, the nine nodes of the tree have been assigned numbers from the set $\left\{1, 2,\ldots,9\right\}$ so that for every ...
makhdoom ghaya
4.2k
views
makhdoom ghaya
asked
Dec 7, 2015
DS
tifr2015
binary-tree
combinatory
+
–
1
votes
2
answers
5184
Implementing Queue with only one pointer
Which of the following statement is/are correct? 1. If we use only Front pointer in queue, then insertion takes O(n) time while deletion in O(1) time. 2. If we use only Rear pointer in queue, then insertion is O(1) and deletion is not possible.
Which of the following statement is/are correct?1. If we use only Front pointer in queue, then insertion takes O(n) time while deletion in O(1) time.2. If we use only Rea...
Tushar Shinde
2.4k
views
Tushar Shinde
asked
Dec 7, 2015
DS
queue
data-structures
+
–
1
votes
1
answer
5185
Meaning of declaration.
sabir
243
views
sabir
asked
Dec 6, 2015
16
votes
3
answers
5186
Find address of element in 3d array
A is an array $[2.....6, 2.....8, 2.......10]$ of elements. The starting location is $500$. The location of an element $A(5, 5, 5)$ using column major order is __________.
A is an array $[2.....6, 2.....8, 2.......10]$ of elements. The starting location is $500$. The location of an element $A(5, 5, 5)$ using column major order is __________...
shikharV
15.6k
views
shikharV
asked
Dec 4, 2015
DS
data-structures
array
algorithms
+
–
1
votes
0
answers
5187
What is subarray and its example?
Whats is subarray ? Can you explain with example?!
Whats is subarray ? Can you explain with example?!
Shashank Chavan
472
views
Shashank Chavan
asked
Dec 3, 2015
Programming in C
programming-in-c
data-structures
+
–
3
votes
2
answers
5188
What is return value of BSR Routine ?
Consider the following function. Assume that the array contains list of all the numbers from 1 to k –1. What is the return value of function BSR? Sum of all numbers Repeated number in the list Average of all the numbers None of these ------------- ... from it which is also (k-1*k) /2 . So it will always return 0. Q 37 Made Easy FLT 6-Practice Test 14
Consider the following function.Assume that the array contains list of all the numbers from 1 to k –1. What is the return value of function BSR?Sum of all numbersRe...
Akash Kanase
999
views
Akash Kanase
asked
Dec 1, 2015
Programming in C
programming
loop
functions
+
–
1
votes
1
answer
5189
BST
certain file system stores records as per binary search tree principles.If the preorder traversal is 90,40,30,190,140,100,290.What is the expected number of comparisons when we randomly request one of the records?
certain file system stores records as per binary search tree principles.If the preorder traversal is 90,40,30,190,140,100,290.What is the expected number of comparisons w...
shreshtha5
569
views
shreshtha5
asked
Nov 30, 2015
DS
binary-search-tree
numerical-answers
+
–
1
votes
3
answers
5190
C program
how it is compiler error int main() { extern int i; printf("%d ", i); { int i = 10; printf("%d ", i); } } (a) 0 10 (b) Compiler Error (c) 0 0 (d) 10 10 ans b
how it is compiler errorint main(){extern int i;printf("%d ", i);{int i = 10;printf("%d ", i);}}(a) 0 10 (b) Compiler Error(c) 0 0 (d) 10 10ans b
tiger
5.1k
views
tiger
asked
Nov 29, 2015
1
votes
2
answers
5191
C program
as i is initialized with 5 in main then how it becomes 0 please explain ? int main() { static int i=5; if(--i) { main(); printf("%d ",i); } } op = 0000
as i is initialized with 5 in main then how it becomes 0 please explain ?int main(){static int i=5;if( i){main();printf("%d ",i);}}op = 0000
tiger
403
views
tiger
asked
Nov 29, 2015
2
votes
1
answer
5192
c program
how statement "printf("%s ", cpp[-1][-1]+1);" works plz explain #include <stdio.h> char *c[] = {"GatsQuiz", "MCQ", "TEST", "QUIZ"}; char **cp[] = {c+3, c+2, c+1, c}; char ***cpp = cp; int main() { printf( ... 3); printf("%s ", *cpp[-2]+3); printf("%s ", cpp[-1][-1]+1); return 0; } o/p TEST sQuiz Z CQ
how statement "printf("%s ", cpp[-1][-1]+1);" works plz explain#include <stdio.h char *c[] = {"GatsQuiz", "MCQ", "TEST", "QUIZ"}; char cp[] = {c+3, c+2, c+1, c}; char ...
tiger
782
views
tiger
asked
Nov 28, 2015
Programming in C
programming-in-c
+
–
1
votes
1
answer
5193
c program
what function fun() does here #include <string.h> #include <stdio.h> #include <stdlib.h> void fun(char** str_ref) { str_ref++; } int main() { char *str = (void *)malloc(100*sizeof(char)); strcpy(str, "gate2016"); fun(&str); puts(str); free(str); return 0; } op gate2016
what function fun() does here#include <string.h>#include <stdio.h>#include <stdlib.h>void fun(char str_ref){str_ref++;}int main(){char *str = (void *)malloc(100*sizeof(c...
tiger
356
views
tiger
asked
Nov 28, 2015
2
votes
1
answer
5194
C program
Explain the array representation used here #include <stdio.h> int main() { int a[][3] = {1, 2, 3, 4, 5, 6}; int (*ptr)[3] = a; printf("%d %d ", (*ptr)[1], (*ptr)[2]); ++ptr; printf("%d %d\n", (*ptr)[1], (*ptr)[2]); return 0; } op=2 3 5 6
Explain the array representation used here#include <stdio.h>int main(){int a[][3] = {1, 2, 3, 4, 5, 6};int (*ptr)[3] = a;printf("%d %d ", (*ptr) , (*ptr) );++ptr;printf("...
tiger
441
views
tiger
asked
Nov 28, 2015
1
votes
1
answer
5195
pointer array
What it means ? int (*p)[R][C];
What it means ?int (*p)[R][C];
tiger
534
views
tiger
asked
Nov 27, 2015
3
votes
0
answers
5196
Total running time of 'm' access operation in a Splay tree .. [GATEFORUM-TEST-DSA]
Vinay Yadav
547
views
Vinay Yadav
asked
Nov 26, 2015
DS
data-structures
tree
+
–
4
votes
2
answers
5197
Program
Explain the line : t = (p += sizeof(int))[-1]; in following program : #include <stdio.h> void f(char**); int main() { char *argv[] = { "ab", "cd", "ef", "gh", "ij", "kl" }; f(argv); return 0; } void f(char **p) { char *t; t = (p += sizeof(int))[-1]; printf("%s\n", t); }
Explain the line :t = (p += sizeof(int))[-1];in following program :#include <stdio.h void f(char ); int main() { char *argv[] = { "ab", "cd", "ef", "gh", "ij", "kl" }; f(...
tiger
3.6k
views
tiger
asked
Nov 26, 2015
Programming in C
programming-in-c
+
–
2
votes
1
answer
5198
Time complexity
What is time complexity to evaluate prefix and postfix expression ? as per me it should be O(n) as atmost 2 pop operation perform and 1 push operation
What is time complexity to evaluate prefix and postfix expression ? as per me it should be O(n) as atmost 2 pop operation perform and 1 push operation
saurav04
1.6k
views
saurav04
asked
Nov 25, 2015
2
votes
2
answers
5199
C prgram
x– = y+1; does the same as: (a) x= x –y +1 (b) x= – x –y – 1 (c) x= –x + y +1 (d) x= x – y – 1 is ans is a ? given d
x– = y+1; does the same as:(a) x= x –y +1 (b) x= – x –y – 1(c) x= –x + y +1 (d) x= x – y – 1is ans is a ?given d
tiger
7.1k
views
tiger
asked
Nov 25, 2015
Programming in C
programming-in-c
programming
+
–
1
votes
0
answers
5200
c program
Explain how to evaluate it how to evaluate recursion within loop Consider the following C function: int fun (int n) { int x=1, k; if (n= =1) return x; for (k=1; k < n; ++k) x = x + fun(k) * fun(n – k); } The return value of fun(5) is __________. (a) 0 (b) 26 (c) 51 (d) 71
Explain how to evaluate ithow to evaluate recursion within loopConsider the following C function:int fun (int n){int x=1, k;if (n= =1) return x;for (k=1; k < n; ++k)x = x...
tiger
294
views
tiger
asked
Nov 25, 2015
Page:
« prev
1
...
255
256
257
258
259
260
261
262
263
264
265
...
310
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register