Previous GATE Questions in Programming and DS

81 votes
6 answers
271
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$
44 votes
5 answers
273
In a binary max heap containing $n$ numbers, the smallest element can be found in time $O(n)$ $O(\log n)$ $O(\log \log n)$ $O(1)$
20 votes
1 answer
275
Draw all binary trees having exactly three nodes labeled $A, B$ and $C$ on which preorder traversal gives the sequence $C, B, A$.
35 votes
3 answers
276
The C language is:A context free languageA context sensitive languageA regular languageParsable fully only by a Turing machine
35 votes
5 answers
278
The number of leaf nodes in a rooted tree of n nodes, with each node having $0$ or $3$ children is:$\frac{n}{2}$$\frac{(n-1)}{3}$$\frac{(n-1)}{2}$$\frac{(2n+1)}{3}$
13 votes
2 answers
280
25 votes
6 answers
282
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$
22 votes
7 answers
288
What is the minimum number of stacks of size $n$ required to implement a queue of size $n$?OneTwoThreeFour