Most answered questions in Programming and DS

81 votes
6 answers
121
Let $T(n)$ be the number of different binary search trees on $n$ distinct elements.Then $T(n) = \sum_{k=1}^{n} T(k-1)T(x)$, where $x$ is $n-k+1$$n-k$$n-k-1$$n-k-2$
25 votes
6 answers
122
In the worst case, the number of comparisons needed to search a single linked list of length $n$ for a given element is$\log n$$\frac{n}{2}$$\log_2 {n} - 1$$n$
3 votes
5 answers
124
Why is the output of the below program 36? int main(){ int a = 1; int b = ++a * ++a * ++a; printf("%d", b ); ​​​​ return 0; }
1 votes
5 answers
125
8 votes
5 answers
128
6 votes
5 answers
129
What is the output of the code given below?# include<stdio.h int main() { char name[]="satellites"; int len; int size; len= strlen(name); size = sizeof(name); printf("%d"...
3 votes
5 answers
130
4 votes
5 answers
131
Let us there are n nodes which are labelled.Then the number of trees possible is given by the Catalan Number i.e $\binom{2n}{n} / (n+1)$Then the binary search trees possi...
5 votes
5 answers
132
______ to evaluate an expression without any embedded function calls.Two stacks are requiredone stack is neededThree stacks are requiredMore than three stacks are require...
2 votes
5 answers
133
What is the output???
2 votes
5 answers
139
A 4-ary tree,i.e. each node has either 0 or 4 children tree has 20 leaf nodes. Then the total number of nodes in the tree are ____.
3 votes
5 answers
140
#include<stdio.h>int f(int a){ a 20 ? return 10: return 20;}int main(){int b=fun(20);return 0;}what will be the output of this program ?