Time Left - 15:00 mins

GATE CS 2022 : Data Structure -2 (App update required to attempt this test)

Attempt now to get your rank among 331 students!

Question 1

Consider the following C program:

What will be the output for above C program?

Question 2

The postfix expression for the infix expression

U+VW/X+Y is

Question 3

If the values p, q, r, s and t are pushed onto the stack in the given order, then identity the invalid stack permutation for the given input sequence.

Question 4

What does the following function return when called as test(6,3)?
test(a,b)
{     
        static int c =0;
        if(b>0)
        {
              c = c + a;
              test(a, b-1) ;
         }
        return c;
}

Question 5

Consider the following traversals of binary search tree:
Post-order: 1, 3, 5, 4, 2, 6, 9, 11, 13, 12, 10, 8, 7
Inorder : 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13  
Find the number of nodes in the last level of binary search tree. Assume root is at first level.

Question 6

void f(int x)

{

if(x =x <<2)

printf(“%d”, x);

}

void main( )

{

int x =3;

f(x + +);

}

The output of the above code is _______ .

  • 331 attempts
  • 2 upvotes
  • 3 comments
May 14GATE & PSU CS

Posted by:

Priya UpadhyayPriya UpadhyayMember since Sep 2020
Priya Upadhyay
Share this quiz   |