1.
The numbers 1, 2, …….., n are inserted in a binary search tree in some order. In the resulting tree, the right subtree of the root contains p nodes. The first number to be inserted in the tree must be
2.
The maximum number of binary trees that can be formed with three unlabeled nodes is:
3.
Consider the following nested representation of binary trees: (X Y Z) indicates Y and Z are the left and right sub stress, respectively, of node X. Note that Y and Z may be NULL, or further nested. Which of the following represents a valid binary tree?
4.
A function f defined on stacks of integers satisfies the following properties:
- \( f(\emptyset) = 0 \)
- \( f(\text{push}(S, i)) = \max(f(S), 0) + i \) for all stacks S and integers i
If a stack S contains the integers 2, -3, 2, -1, 2 in order from bottom to top, what is \( f(S) \)?
[GATE-2005]
5.
Which of the following sequences denotes the post order traversal sequence of the tree of previous question?
6.
Let P be an array containing n integers. Let t be the lowest upper bound on the number of comparisons of the array elements, required to find the minimum and maximum values in an arbitrary of n elements. Which one of the following choices is correct?
7.
In the worst case, the number of comparisons needed to search a singly linked list of length n for a given element is
8.
A circularly linked list is used to represent a Queue. A single variable \( p \) is used to access the Queue. To which node should \( p \) point such that both the operations enQueue and deQueue can be performed in constant time?

[GATE-2004]
9.
The following sequence is performed on an empty stack: PUSH(A), PUSH(B), POP, PUSH(C), POP, PUSH(D), POP, POP What is the sequence of popped values?
10.
The following function computes the value of \( ^mC_n \) correctly for all legal values m and n (m≥1,n≥0 and m>n)
int func(int m, int n) {
    if (E) return 1;
    else return(func(m-1,n) + func(m-1,n-1));
}
In the above function, which of the following is the correct expression for E?