1
GATE CSE 2006
MCQ (Single Correct Answer)
+1
-0.3
In a binary tree, the number of internal nodes of degree 1 is 5, and the number of internal nodes of degree 2 is 10. The number of leaf nodes in the binary tree is
A
10
B
11
C
12
D
15
2
GATE CSE 2006
MCQ (Single Correct Answer)
+1
-0.3
A scheme for storing binary trees in an array X is as follows. Indexing of X starts at 1 instead of 0. the root is stored at X[1]. For a node stored at X[i], the left child, if any, is stored in X[2i] and the right child, if any, in X[2i+1]. To be able to store any binary tree on n vertices the minimum size of X should be
A
log2 n
B
n
C
2n + 1
D
2n-1
3
GATE CSE 2006
MCQ (Single Correct Answer)
+2
-0.6
The following function computes the value of mCn 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?
A
(n = = 0) || (m = = 1)
B
(n = = 0) && (m = = 1)
C
(n = = 0) || (m = = n)
D
(n = = 0) && (m = = n)
4
GATE CSE 2006
MCQ (Single Correct Answer)
+2
-0.6
An implementation of a queue Q, using two stacks S1 and S2, is given below:
void insert(Q, X){
  push(S1, X);
}

void delete(Q){
 if(stack - empty(S1)) then {
   print("Q is empty");
   return;
 }else while (!(stack - empty(S1))){
   X = pop(S1);
   push(S2, X);
 }
 X = pop(S2);
}
Let n insert and $$m( \le n)$$ delete operations be performed in an arbitrary order on an empty queue Q. Let x and y be the number of push and pop operations performed respectively in the process. Which one of the following is true for all m and n?
A
$$n + m \le x \le 2n$$ and $$2m \le y \le n + m$$
B
$$n + m \le x \le 2n$$ and $$2m \le y \le 2n$$
C
$$2m \le x \le 2n$$ and $$2m \le y \le n + m$$
D
$$2m \le x \le 2n$$ and $$2m \le y \le 2n$$
EXAM MAP
Medical
NEETAIIMS
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
Civil Services
UPSC Civil Service
Defence
NDA
Staff Selection Commission
SSC CGL Tier I
CBSE
Class 12