1
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)
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)
+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
4
GATE CSE 2006
MCQ (Single Correct Answer)
+2
-0.6
Suppose that we have numbers between 1 and 100 in a binary search tree and want to search for the number 55. Which of the following sequences CANNOT be the sequence of nodes examined?
A
{10, 75, 64, 43, 60, 57, 55}
B
{90, 12, 68, 34, 62, 45, 55}
C
{9, 85, 47, 68, 43, 57, 55}
D
{79, 14, 72, 56, 16, 53, 55}
EXAM MAP
Medical
NEET
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
CBSE
Class 12