1
GATE CSE 2007
MCQ (Single Correct Answer)
+1
-0.3
The height of a binary tree is the maximum number of edges in any root to leaf path. The maximum number of nodes in a binary tree of height h is:
A
2h-1
B
2h-1-1
C
2h+1-1
D
2h+1
2
GATE CSE 2007
MCQ (Single Correct Answer)
+1
-0.3
The maximum number of binary trees that can be formed with three unlabeled nodes is:
A
1
B
5
C
4
D
3
3
GATE CSE 2007
MCQ (Single Correct Answer)
+2
-0.6
Consider the following C program:
#include 
#define EOF -1 
     void push (int); /* push the argument on the stack */ 
     int pop (void); /* pop the top of the stack */ 
     void flagError (); 
     int main () { 
       int c, m, n, r; 
       while ((c = getchar ()) != EOF) { 
         if (isdigit (c) ) 
           push (c); 
         else if ((c == '+') || (c == '*')) { 
           m = pop (); 
           n = pop (); 
           r = (c == '+') ? n + m : n*m; 
           push (r); 
         } else if (c != ' ') 
           flagError (); 
       } 
       printf("% c", pop ()); 
    } 
What is the output of the program for the following input ? 5 2 * 3 3 2 + * +
A
15
B
25
C
30
D
150
4
GATE CSE 2007
MCQ (Single Correct Answer)
+2
-0.6
Suppose you are given an implementation of a queue of integers. The operations that can be performed on the queue are:
i. isEmpty (Q) — returns true if the queue is empty, false otherwise.
ii. delete (Q) — deletes the element at the front of the queue and returns its value.
iii. insert (Q, i) — inserts the integer i at the rear of the queue.
Consider the following function:
void f (queue Q) { 
  int i ; 
  if (!isEmpty(Q)) { 
      i = delete(Q); 
      f(Q); 
      insert(Q, i); 
  } 
} 
What operation is performed by the above function f ?
A
Leaves the queue Q unchanged
B
Reverses the order of the elements in the queue Q
C
Deletes the element at the front of the queue Q and inserts it at the rear keeping the other elements in the same order
D
Empties the queue Q
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