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
0
answers
1951
Integer in c
saumya mishra
130
views
saumya mishra
asked
May 15, 2018
0
votes
2
answers
1952
Modulous operator
saumya mishra
375
views
saumya mishra
asked
May 15, 2018
–1
votes
0
answers
1953
Printf
saumya mishra
162
views
saumya mishra
asked
May 15, 2018
Programming in C
bad-question
+
–
1
votes
1
answer
1954
Size of operator
#include<stdio.h> int main(void) { printf("bytes occupied by '7' = %d\n", sizeof('7')); printf("bytes occupied by 7 = %d\n", sizeof(7)); printf("bytes occupied by 7.0 = %d\n", sizeof(7.0)); return 0; }
#include<stdio.h int main(void) { printf("bytes occupied by '7' = %d\n", sizeof('7')); printf("bytes occupied by 7 = %d\n", sizeof(7)); printf("bytes occupied by 7.0 = %d...
saumya mishra
1.6k
views
saumya mishra
asked
May 15, 2018
Programming in C
programming-in-c
sizeof-operator
+
–
1
votes
2
answers
1955
AVL Tree
Minimum number of internal nodes in an AVL tree with height 5? Please give a standard procedure that can be applied to larger heights as well. I know the formula: S(h) = S(h-1) + S(h-2) + 1, but here it is asked for internal nodes only. Drawing a tree is tedious.
Minimum number of internal nodes in an AVL tree with height 5?Please give a standard procedure that can be applied to larger heights as well. I know the formula: S(h) = S...
Akhilesh Singla
1.2k
views
Akhilesh Singla
asked
May 15, 2018
DS
avl-tree
tree
+
–
0
votes
0
answers
1956
C Programming MACROS
Can someone explain how the output is derived for the second printf statement. I have not understood how the value of x changed to 13 instead of 10. Detailed step by step explanation please. #include <stdio.h> #define f(a,b) a+b #define g(a,b) f(a,b)/f(a,b) int main(){ int x=4; g(x,x+1); printf("%d\n",x); x=g(x,x+1); printf("%d",x); return 0; }
Can someone explain how the output is derived for the second printf statement.I have not understood how the value of x changed to 13 instead of 10. Detailed step by step ...
slowpoke
622
views
slowpoke
asked
May 14, 2018
Programming in C
programming-in-c
+
–
0
votes
0
answers
1957
Better Algorithm for aggregating data from LDAP Systems
This question is not related to GATE, but certainly would help you to grill your mind to come up with a better approach.. Feel free to comment if you think, this is not a right forum for this question. I have 10 ... format cannot be changed as there is dependency with other downstream systems. Is there a better approach to achieve the same ?
This question is not related to GATE, but certainly would help you to grill your mind to come up with a better approach.. Feel free to comment if you think, this is not a...
Arunav Khare
283
views
Arunav Khare
asked
May 14, 2018
Programming in C
algorithms
searching
+
–
0
votes
4
answers
1958
Why b is not decrementing ?
main() { int a = 1; int b = 1; int c = a || b--; printf("a = %d b=%d\n",a,b); return 0; }
main(){int a = 1; int b = 1; int c = a || b ; printf("a = %d b=%d\n",a,b); return 0;}
anonymous
334
views
anonymous
asked
May 14, 2018
Programming in C
programming-in-c
+
–
0
votes
1
answer
1959
Binary Tree
How to generate post order array from given in order array [8,6,9,4,7,2,5] ?
How to generate post order array from given in order array [8,6,9,4,7,2,5] ?
raman.pndy
468
views
raman.pndy
asked
May 14, 2018
Programming in C
binary-tree
data-structures
+
–
0
votes
1
answer
1960
gfg C pointer Basic
Please explain solution in brief . #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); } A] ab B] cd C] ef D] gh
Please explain solution in brief . #include <stdio.h void f(char ); int main() { char *argv[] = { "ab", "cd", "ef", "gh", "ij", "kl" }; f(argv); return 0; } void f(char ...
anonymous
579
views
anonymous
asked
May 14, 2018
Programming in C
programming-in-c
+
–
0
votes
2
answers
1961
gfg c pointer basic
What changes must be done for printing value 5. #include <stdio.h> int main() { int var; /*Suppose address of var is 2000 */ void *ptr = &var; *ptr = 5; printf("var=%d and *ptr=%d",var,*ptr); return 0; }
What changes must be done for printing value 5. #include <stdio.h int main() { int var; /*Suppose address of var is 2000 */ void *ptr = &var; *ptr = 5; printf("var=%d and...
anonymous
511
views
anonymous
asked
May 14, 2018
Programming in C
programming-in-c
+
–
0
votes
0
answers
1962
MinHeap
In a min-heap with $n$ elements with the smallest element at the root, the $log n^{th}$ smallest element can be found in time. Is this approach correct? For $1$ st smallest - root node is the element - takes $0$ comparison For $2$ nd smallest - $2$ elements are to be compared - ... $\frac{(logn)(logn+1)}{2}$ = $O$(logn)$2$ Please suggest is this correct approach??
In a min-heap with $n$ elements with the smallest element at the root, the $log n^{th}$ smallest element can be found in time.Is this approach correct?For $1$ st smallest...
!KARAN
212
views
!KARAN
asked
May 13, 2018
0
votes
0
answers
1963
Finding diameter of Binary Tree
How do we find the diameter of a Binary tree? I have come to below algorithm. Please let me know if it works (1)Use BFS on root's left subtree to find the last processed node say node1. (2)Use BFS on root's right subtree ... node1 as source and we keep counting the number of nodes that appear before our node2 appears. This count will give us the diameter.
How do we find the diameter of a Binary tree?I have come to below algorithm. Please let me know if it works(1)Use BFS on root's left subtree to find the last processed no...
Ayush Upadhyaya
301
views
Ayush Upadhyaya
asked
May 10, 2018
Programming in C
binary-tree
data-structures
+
–
1
votes
1
answer
1964
Finding deepest node of a binary tree.
We want to find an algorithm for finding the deepest node of a binary tree. My idea is to use BFS (Breadth-first search) and while visiting each node we will initialize it's node.dvalue(which will indicate how much far is node ... node for whose dvalue is maximum, and that will give me node with the highest depth. Is my above-suggested algorithm correct?
We want to find an algorithm for finding the deepest node of a binary tree.My idea is to use BFS (Breadth-first search) and while visiting each node we will initialize it...
Ayush Upadhyaya
486
views
Ayush Upadhyaya
asked
May 10, 2018
0
votes
1
answer
1965
Doubt
The number of times “MadeEasy” will be printed ________.
The number of times “MadeEasy” will be printed ________.
Na462
299
views
Na462
asked
May 10, 2018
Programming in C
programming-in-c
+
–
0
votes
1
answer
1966
Doubt
Consider a stack is used to evaluate fully parenthesized arithmetic expression from left to right. Each opperand is placed on the stack and operators operate on top two elements of the stack. The minimum size of stack required to evaluate given expression is ________.
Consider a stack is used to evaluate fully parenthesized arithmetic expression from left to right. Each opperand is placed on the stack and operators operate on top two e...
Na462
278
views
Na462
asked
May 10, 2018
Programming in C
algorithms
+
–
0
votes
2
answers
1967
Doubt
Consider A be a 2-dimensional array declared as follows: A[15] [15] of integers. Assume each integer take 1B. The array stored in row major order and first element of array is stored at location 1000, then the address of element a[10] [6] is ________ B.
Consider A be a 2-dimensional array declared as follows: A[15] [15] of integers. Assume each integer take 1B. The array stored in row major order and first element of arr...
Na462
221
views
Na462
asked
May 10, 2018
Programming in C
algorithms
+
–
0
votes
1
answer
1968
Data Structure Doubt
Which of the following is true? A . In a sorted array of n' distinct elements, deletion of an element take Ο(log n) time B. In sorted array of n' distinct elements, insertion of an element take Ο(log n) time. C. In unsorted array of n' ... finding ith largest element take Ο(1) time D. In unsorted array of n' distinct elements, insertion of an element take Ω(log n) time
Which of the following is true?A . In a sorted array of ‘n’ distinct elements, deletion of an element take Ο(log n) timeB. In sorted array of ‘n’ distinct eleme...
Na462
3.3k
views
Na462
asked
May 10, 2018
Programming in C
data-structures
+
–
0
votes
0
answers
1969
self doubt
1)Please correct me if anything written in comment // is wrong 2) also tell me why why did ABC getdata()and ABC & getdata() both are true as return type #include<stdio.h> struct ABC { int x; ABC getdata()//ABC & getdata() is also true { ABC *obj; obj->x ... ;,*NVP); ABC obj,obj1; obj1=obj.getdata(); printf("%d\n",obj1.x); } Output:-6 6 6 10 [Finished in 0.1s]
1)Please correct me if anything written in comment // is wrong 2) also tell me why why did ABC getdata()and ABC & getdata() both are true as return type#include<stdio.h s...
kd.....
160
views
kd.....
asked
May 10, 2018
Programming in C
programming-in-c
+
–
0
votes
0
answers
1970
C programming
Can someone explain why this is happening. I have found post increment has higher precedence than pre-increment . And Post increment is left associative and pre-increment is right associative. For the 1st printf it it is 5,6 but the 2nd printf it is 6,7 Why in post increment both statemet has differenet value. https://www.geeksforgeeks.org/c-operator-precedence-associativity/
Can someone explain why this is happening. I have found post increment has higher precedence than pre-increment . And Post increment is left associative and pre-increment...
Abhijit Sen 4
984
views
Abhijit Sen 4
asked
May 7, 2018
Programming in C
programming-in-c
operator-precedence
+
–
Page:
« prev
1
...
93
94
95
96
97
98
99
100
101
102
103
...
309
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register