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
7
votes
3
answers
5141
What is the difference between static scoping and dynamic scoping?
sampad
8.0k
views
sampad
asked
Oct 11, 2015
Programming in C
programming
variable-binding
+
–
23
votes
3
answers
5142
TIFR CSE 2010 | Part B | Question: 37
Consider the program where $a, b$ are integers with $b > 0$. x:=a; y:=b; z:=0; while y > 0 do if odd (x) then z:= z + x; y:= y - 1; else y:= y % 2; x:= 2 * x; fi Invariant of the loop is a condition which is ... terminate for some values of $a, b$ but when it does terminate, the condition $z = a * b$ will hold. The program will terminate with $z=a^{b}$
Consider the program where $a, b$ are integers with $b 0$.x:=a; y:=b; z:=0; while y 0 do if odd (x) then z:= z + x; y:= y - 1; else y:= y % 2; x:= 2 * x; fiInvariant of...
makhdoom ghaya
3.3k
views
makhdoom ghaya
asked
Oct 10, 2015
Programming in C
tifr2010
programming
loop-invariants
+
–
16
votes
2
answers
5143
TIFR CSE 2010 | Part B | Question: 31
Consider the following computation rules. Parallel-outermost rule: Replace all the outermost occurrences of F (i.e., all occurrences of F which do not occur as arguments of other F's) simultaneously. Parallel - innermost rule: Replace all the innermost ... $0$ and $0$ respectively $w$ and $w$ respectively $w$ and $1$ respectively none of the above
Consider the following computation rules. Parallel-outermost rule: Replace all the outermost occurrences of F (i.e., all occurrences of F which do not occur as arguments ...
Arjun
1.6k
views
Arjun
asked
Oct 10, 2015
Programming in C
tifr2010
programming
recursion
+
–
0
votes
2
answers
5144
What is the criteria for distinguishing data structure in terms of linear and non-linear ?
What is the criteria for distinguishing data structure in terms of linear and non-linear ? I am bit confused with the criteria for this. I have search and tried to clear this confusion but then i got more ... categorizing on the basis of storage in the memory and some place it is on the basis of traversal.
What is the criteria for distinguishing data structure in terms of linear and non-linear ?I am bit confused with the criteria for this. I have search and tried to clear t...
IgnitorSandeep
853
views
IgnitorSandeep
asked
Oct 10, 2015
DS
data-structures
+
–
16
votes
2
answers
5145
TIFR CSE 2010 | Part B | Question: 30
Consider the following program for summing the entries of the array $b$: array $[0 .. N-1]$ of integers, where $N$ is a positive integer. (The symbol '$<>$' denotes 'not equal to'). var i, s: integer; Program i:= 0; s:= 0; [*] while i <> N ... $s = \sum\limits^{i-1}_{j=0}b[j] \;\&\; 0 \leq i \leq N$
Consider the following program for summing the entries of the array $b$: array $[0 .. N-1]$ of integers, where $N$ is a positive integer. (The symbol '$<>$' denotes 'not ...
makhdoom ghaya
2.7k
views
makhdoom ghaya
asked
Oct 8, 2015
Programming in C
tifr2010
programming
loop-invariants
+
–
2
votes
1
answer
5146
float
following statment printf("%f",9/5); prints answer is 2.0 can any one explain plzzzzz
following statmentprintf("%f",9/5);prints answer is 2.0 can any one explain plzzzzz
admin
2.0k
views
admin
asked
Oct 8, 2015
1
votes
2
answers
5147
What is the output of the following C code?
int main (){ int a=5,b=3; printf("%d", a+++++b); // 5 +'s } Please Explain.
int main (){ int a=5,b=3; printf("%d", a+++++b); // 5 +'s }Please Explain.
Umang Raman
1.1k
views
Umang Raman
asked
Oct 7, 2015
Programming in C
programming-in-c
+
–
49
votes
5
answers
5148
TIFR CSE 2010 | Part B | Question: 26
Suppose there is a balanced binary search tree with $n$ nodes, where at each node, in addition to the key, we store the number of elements in the sub tree rooted at that node. Now, given two elements $a$ and $b$, such that $a < b$ ... $O(n)$ comparisons and $O(n)$ additions, using depth-first- search.
Suppose there is a balanced binary search tree with $n$ nodes, where at each node, in addition to the key, we store the number of elements in the sub tree rooted at that ...
makhdoom ghaya
8.6k
views
makhdoom ghaya
asked
Oct 6, 2015
DS
tifr2010
binary-search-tree
+
–
1
votes
1
answer
5149
Scoping and Call by Need evaluation
Find the output of the below program in case of Dynamic Scoping with call by need evaluation method int x=10,y=10; main() { int x=2; int y=3; fun1(x+y,5); printf("x"); } fun1(int z,int k) { k=z+k; }
Find the output of the below program in case of Dynamic Scoping with call by need evaluation methodint x=10,y=10;main(){int x=2;int y=3;fun1(x+y,5);printf("x");}fun1(int ...
admin
721
views
admin
asked
Oct 5, 2015
Programming in C
programming-in-c
+
–
2
votes
1
answer
5150
What is the output of the program ?
int main(){ char *ptr = "gateexam"; printf("%c\n", *&*&*ptr); return 0; } (a) Compiler Error (b) Garbage Value (c) Runtime Error (d) g *please explain it.
int main(){ char *ptr = "gateexam"; printf("%c\n", *&*&*ptr); return 0; }(a) Compiler Error(b) Garbage Value(c) Runtime Error(d) g*please explain it.
IgnitorSandeep
473
views
IgnitorSandeep
asked
Oct 5, 2015
Programming in C
programming-in-c
+
–
4
votes
3
answers
5151
Let a, b be two positive integers, which of the following options correctly relates / and %?
Let a, b be two positive integers, which of the following options correctly relates / and %? (a) b= (a/b) * b + a%b (b) b= (a%b) * b + a/b (c) a= (a/b) * b + a%b (d) a= (a%b) * b + a/b * I am getting answer as c but the answer given is b. Please tell me which one is correct.
Let a, b be two positive integers, which of the following options correctly relates / and %?(a) b= (a/b) * b + a%b(b) b= (a%b) * b + a/b(c) a= (a/b) * b + a%b(d) a= (a%b)...
IgnitorSandeep
6.5k
views
IgnitorSandeep
asked
Oct 5, 2015
Programming in C
programming
programming-in-c
+
–
8
votes
1
answer
5152
ISRO2008-1
Which of the following is an illegal array definition? Type COLONGE : (LIME, PINE, MUSK, MENTHOL); var a : array [COLONGE] of REAL; var a : array [REAL] of REAL; var a : array [‘A’…’Z’] of REAL; var a : array [BOOLEAN] of REAL;
Which of the following is an illegal array definition?Type COLONGE : (LIME, PINE, MUSK, MENTHOL); var a : array [COLONGE] of REAL;var a : array [REAL] of REAL;var a : ar...
अनुराग पाण्डेय
9.2k
views
अनुराग पाण्डेय
asked
Oct 4, 2015
Programming in C
isro2008
array
+
–
1
votes
1
answer
5153
Why is the output of these two programs different in C?
#include int main(){ float x = 0.1; if (x == 0.1) printf("IF"); else if (x == 0.1f) printf("ELSE IF"); else printf("ELSE"); return 0; } #include int ... 0; } First program Output: ELSE IF Second program Output: IF Both programs are similar.But outputs are different.Why?
#includeint main(){ float x = 0.1; if (x == 0.1) printf("IF"); else if (x == 0.1f) printf("ELSE IF"); else ...
admin
1.1k
views
admin
asked
Oct 3, 2015
0
votes
2
answers
5154
output?
#define int char main(){ int i=66; printf("%d",sizeof(i)); }
#define int charmain(){int i=66;printf("%d",sizeof(i));}
sdpshaw
640
views
sdpshaw
asked
Oct 2, 2015
Programming in C
programming
programming-in-c
+
–
2
votes
3
answers
5155
find first repeated element..
given an array of n element, what will be the time complexity to find 1st repeated element when array have more than one repeated elements??
given an array of n element, what will be the time complexity to find 1st repeated element when array have more than one repeated elements??
yes
1.0k
views
yes
asked
Oct 1, 2015
10
votes
3
answers
5156
ISRO2011-11
How many distinct binary search trees can be created out of $4$ distinct keys? $5$ $14$ $24$ $35$
How many distinct binary search trees can be created out of $4$ distinct keys?$5$$14$$24$$35$
ajit
10.2k
views
ajit
asked
Oct 1, 2015
DS
isro2011
data-structures
binary-search-tree
combinatory
+
–
1
votes
3
answers
5157
what is the output of the following c code?
what is the output of the following c code? #include<stdio.h> void main() { int index; for(index=1;index<=5;index++) { printf("%d",index); if(index==3) continue; } } a)1245 b)12345 c)12245 d)12354
what is the output of the following c code?#include<stdio.h void main() { int index; for(index=1;index<=5;index++) { printf("%d",index); if(index==3) continue; } }a)1245b...
ajit
1.6k
views
ajit
asked
Oct 1, 2015
Programming in C
programming-in-c
+
–
0
votes
5
answers
5158
What is the level number of an element present in an array of n integers interpreted as a complete binary tree?
If I am given an array $X$ of $n$ distinct integers which is interpreted as a complete binary tree, so if the parent is at index $i$, then it's left child would be at ind...
radha gogia
1.6k
views
radha gogia
asked
Sep 30, 2015
DS
binary-tree
data-structures
+
–
3
votes
2
answers
5159
what is the meaning of probe sequence in hashing ?
I am unable to understand the meaning of probe sequence in context of no of slots , I have seen questions like no of probe sequences possible in quadratic or linear probing is m while in double hashing it is m^2 , so what is the ... sequence , is it that once collision occurs , so now to which index will the key would be next mapped on to ?
I am unable to understand the meaning of probe sequence in context of no of slots , I have seen questions like no of probe sequences possible in quadratic or linear probi...
radha gogia
7.1k
views
radha gogia
asked
Sep 30, 2015
0
votes
1
answer
5160
What is the no. of nodes in the tree that has exactly one child?
In a binary tree with n nodes every node has an odd no. of descendants. Every node is considered to be its own descendant. What is the no. of nodes in the tree that has exactly one child? (a) 0 (b) 1 (c) (n-1)/ 2 (d) n-1
In a binary tree with n nodes every node has an odd no. of descendants. Every node is considered to be its own descendant. What is the no. of nodes in the tree that has e...
IgnitorSandeep
1.3k
views
IgnitorSandeep
asked
Sep 28, 2015
Programming in C
data-structures
+
–
Page:
« prev
1
...
253
254
255
256
257
258
259
260
261
262
263
...
309
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register