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
0
votes
0
answers
4861
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); } }
#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) ...
shivam sharma 5
6.4k
views
shivam sharma 5
asked
Aug 27, 2018
Programming in C
recursion
+
–
0
votes
0
answers
4862
Array base address and first element address
#include <stdio.h> int main(void) { char a[5] = { 1, 2, 3, 4, 5 }; char *ptr = (char*)(&a + 1); printf("%d %d\n", *(a + 1), *(ptr - 1)); return 0; } what is o/p of this program? how does a and &a denote different things in an array? please explain
#include <stdio.h int main(void) { char a[5] = { 1, 2, 3, 4, 5 }; char *ptr = (char*)(&a + 1); printf("%d %d\n", *(a + 1), *(ptr - 1)); return 0; }what is o/p of this pro...
Priya0612
147
views
Priya0612
asked
Aug 23, 2018
1
votes
0
answers
4863
MCQs in computer science
What are the correct options?
What are the correct options?
Rustam Ali
508
views
Rustam Ali
asked
Aug 23, 2018
1
votes
0
answers
4864
Let Us C- Q2.43
Output will be- int main(){ int a =0,b=1,c=3: *((a)?&b&:&a)=a ? b : c; printf("%d %d%d ", a,b,c); }
Output will be-int main(){ int a =0,b=1,c=3:*((a)?&b&:&a)=a ? b : c;printf("%d %d%d ", a,b,c);}
KashishNarang
266
views
KashishNarang
asked
Aug 23, 2018
0
votes
0
answers
4865
Gate forum test series
nag.swarna
349
views
nag.swarna
asked
Aug 23, 2018
DS
infix-prefix
+
–
0
votes
0
answers
4866
Identify invalid DFS search sequences
Sandeep Muthabathula
180
views
Sandeep Muthabathula
asked
Aug 22, 2018
0
votes
0
answers
4867
C programming
include <stdio.h> int main() { char *c[]={"abhi","abhishek","abhisheksing"}; printf("%s",(*(*(c+2)+7))); return 0; } What is the output?
include <stdio.h>int main(){ char *c[]={"abhi","abhishek","abhisheksing"}; printf("%s",(*(*(c+2)+7))); return 0;} What is the output?
Spider1896
410
views
Spider1896
asked
Aug 22, 2018
0
votes
0
answers
4868
Pointer Doubt
Suppose in P3 the free statement was not present then P3 will not be creating any problem right because when i return p3 it will return basically what its pointing to which is dynamically allocated memory from heap which will be there even though px doesn't exist ... value can be stored in another pointer now Right ?? Right now P3 is the case of Dangling Pointer isn't it ?
Suppose in P3 the free statement was not present then P3 will not be creating any problem right because when i return p3 it will return basically what its pointing to whi...
Na462
234
views
Na462
asked
Aug 22, 2018
DS
programming-in-c
pointers
+
–
0
votes
0
answers
4869
Output of Following C Program
What will be output ? A. Abnormal Termination. B. Infinite loop C. Output wil be 65536 D. None Ans. D
What will be output ?A. Abnormal Termination.B. Infinite loopC. Output wil be 65536D. NoneAns. D
Na462
480
views
Na462
asked
Aug 22, 2018
DS
programming-in-c
programming
output
+
–
0
votes
0
answers
4870
Recursive Programs
Let R represents class of Recursive Programs and I denotes class of Iterative Program. Which of them is incorrect ? A. Some Program belonging to R doesn't Terminate. B. For every Program in I there is a equivalent recursive program in R. C. Every Program in R uses strictly more stack space compared to its equivalent program in I D. None Ans. C
Let R represents class of Recursive Programs and I denotes class of Iterative Program. Which of them is incorrect ?A. Some Program belonging to R doesn't Terminate.B. For...
Na462
2.3k
views
Na462
asked
Aug 22, 2018
Programming in C
programming-in-c
+
–
0
votes
0
answers
4871
C programming
#include<stdio.h> void main() { char c[]="abhishek"; for(int i=0;i<8;i++) { c[i]="a"; printf("%c",c[i]); } } What is the error in it?
#include<stdio.h>void main(){ char c[]="abhishek"; for(int i=0;i<8;i++) {c[i]="a"; printf("%c",c[i]); } }What is the error in it?
Spider1896
320
views
Spider1896
asked
Aug 21, 2018
4
votes
0
answers
4872
Breadth first Search
Which of following statement is true ? A. In BFS of UDG there are no back edges and forward edges. B. In BFS of Directed Graph there is no back edge and forward edges. C. In BFS of UDG for each back edge(u,v) we have 0<= v.d <= u.d D. Both b and c. Ans. A
Which of following statement is true ?A. In BFS of UDG there are no back edges and forward edges.B. In BFS of Directed Graph there is no back edge and forward edges.C. In...
Na462
3.9k
views
Na462
asked
Aug 21, 2018
DS
breadth-first-search
data-structures
graph-algorithms
+
–
3
votes
0
answers
4873
Depth first search
The maximum number of edges possible with UDG of n nodes,when DFS call on any random node in the graph result in stack size of 5. i.e. 5 function calls present in stack simultaneously are ......... Ans. 10
The maximum number of edges possible with UDG of n nodes,when DFS call on any random node in the graph result in stack size of 5. i.e. 5 function calls present in stack s...
Na462
1.3k
views
Na462
asked
Aug 21, 2018
DS
depth-first-search
data-structures
graph-algorithms
+
–
0
votes
0
answers
4874
Heap Data Structure
How traversal in a heap takes place? Consider a min heap , I think we cannot traverse it like a binary tree ......For Example if we have to print all elements of heap Do we need to perform delete operation on root O(1) time then perform Heapify O(lgn) and again perform delete and so on which overall takes O(N) time ? Whether same is for search as well Plz explain...
How traversal in a heap takes place? Consider a min heap , I think we cannot traverse it like a binary tree ......For Example if we have to print all elements of heap ...
Shiv Gaur
687
views
Shiv Gaur
asked
Aug 20, 2018
DS
binary-heap
algorithms
time-complexity
+
–
1
votes
0
answers
4875
Pointers
#include<stdio.h> int main() { char A[5][7][6]; char *p[5][7][6]; printf("%d\t", (unsigned)(A+1)-(unsigned)A); printf("%d", (unsigned)(p+1)-(unsigned)p); } What will be the output ?? 1. 42 ,42 2. 42,336 3. 336,42 4. 1,1
#include<stdio.h>int main(){char A[5][7][6];char *p[5][7][6];printf("%d\t", (unsigned)(A+1)-(unsigned)A);printf("%d", (unsigned)(p+1)-(unsigned)p);}What will be the outpu...
Solarica Palit
303
views
Solarica Palit
asked
Aug 19, 2018
Programming in C
pointers
+
–
0
votes
0
answers
4876
gate 2007
GATE 2007 QUESTION(DOUBT) https://gateoverflow.in/3465/gate2007-it-32 Guys in this question %c is there in printf.......and ans is 25.....but why the ASCII value of 25 is not printed????? As %c is used here. Kindly help where I am getting wrong??
GATE 2007 QUESTION(DOUBT)https://gateoverflow.in/3465/gate2007-it-32Guys in this question %c is there in printf.......and ans is 25.....but why the ASCII value of 25 is n...
himanshu19
373
views
himanshu19
asked
Aug 19, 2018
0
votes
0
answers
4877
Heap Sorting
Consider a binary tree, where left and right subtreealready heapified. But we havenot done heapificationfor root yet. Then what is time complexity to convert it in a full heap tree? $A)O(\log n)$ or $o(n)$ $B)\Omega (\log n)$ or $\omega(n)$ $C)\Theta (\log n)$ or $\theta (n)$ $D)\text{None of these}$
Consider a binary tree, where left and right subtreealready heapified. But we havenot done heapificationfor root yet. Then what is time complexity to convert it in a full...
srestha
1.6k
views
srestha
asked
Aug 18, 2018
DS
algorithms
sorting
binary-heap
time-complexity
+
–
0
votes
0
answers
4878
Merge Sort (Code)
why this margeSort program showing time limit exceed ? #include <stdio.h> #include <stdlib.h> #include <time.h> void fillArray(int array[], int n) { time_t t; time(&t);//get current time srand(t);//gives current time as seed ... CLOCKS_PER_SEC; printArray(Array, n); printf("\n \n Time taken for sorting: %f seconds\n\n",cpu_time_used); return 0; }
why this margeSort program showing time limit exceed ?#include <stdio.h #include <stdlib.h #include <time.h void fillArray(int array[], int n) { time_t t; time(&t);//get ...
srestha
586
views
srestha
asked
Aug 18, 2018
Programming in C
merge-sort
algorithms
sorting
+
–
1
votes
0
answers
4879
gate 15 set-2
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) return x; } return value of fun(5)??? how to solve this using tree method approach???
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)return x;}return value of fun(5)??? how to solve this using tree method approach???
Phalkey
306
views
Phalkey
asked
Aug 18, 2018
0
votes
0
answers
4880
multi dimensional array
Let A be a two-dimensional array declared as follows: A: array[1..23][1..19] of integer; Assuming that each integer takes one memory location, the array is stored in rowmajor order and the first element of the array is stored at the location. Find out the address of the address of the element A[i][j].
Let A be a two-dimensional array declared as follows: A: array[1..23][1..19] of integer; Assuming that each integer takes one memory location, the array is stored in rowm...
ritus
482
views
ritus
asked
Aug 17, 2018
Page:
« prev
1
...
239
240
241
242
243
244
245
246
247
248
249
...
310
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register