Self Studies

Programming and...

TIME LEFT -
  • Question 1
    2 / -0.33

    What is the maximum height of any AVL tree with 20 nodes?

    NOTE: Height of tree with single node is 0.

  • Question 2
    2 / -0.33

    Which one of the choices given below would be printed when the following program is executed?

    #include<stdio.h>

    struct node {

    int i;

    char *s;

    }tb[] = {1, "poor", 10, "average", 3, "good", 4, "very good", 5, "excellent"};

    int main()

    {

    struct node *p = tb;

    printf("%s", (++p+2)-> s);

    return 0;

    }

  • Question 3
    2 / -0.33

    Consider a binary tree which consist of 255 nodes. Height of a tree is 1 if it consists of single node. What is the minimum height of the tree?

  • Question 4
    2 / -0.33

    What is the output of the below given code
    #include<stdio.h>
    #include<string.h>
    int main()
    {
    char s1[] = "TESTBOOk";
    char s2[] = "TESTBOOK";
    printf("%d",strcmp(s1,s2));
    return 0;
    }

  • Question 5
    2 / -0.33

    Consider the following C program:

    #include <stdio.h>

    int main ( )

    {

    int  A[ ] = {4, 3, 2, 1, 5, 6, 7, 9, 10, 11, 12, 0 }, *ptr = A + 6;

    printf (“ % d \n”, 3[ptr]);

    return 0;

    }

    The number that will be displayed on execution of the program is _________.

  • Question 6
    2 / -0.33

    Consider the following C program:

    #include <stdio.h>

    int swap (int *p, int  *q)

    {

    *p = 3*(*p) + (*q);

    return *p;

    }

    int main ( )

    {

    int a = 12, b = 21;

    a = swap(&b, &a);

    b = swap(&a, &b);

    printf("%d\n", b);

    }

    The value printed by the program is _________.

  • Question 7
    2 / -0.33

    Carefully observe the below given queue

    REAR

    22

    57

    96

    68

    19

    15

    28

    FRONT

     

    How many dequeue operations needed to delete the largest element from the queue?

  • Question 8
    2 / -0.33

    Consider a two dimensional array X[-10…5, 7….15] in which staring location is at 250. If every data of given array takes 4 byte of space and store in column major order, then what will be the location of A[2][10]

  • Question 9
    2 / -0.33

    Which of the following statement is/are not true?

    I. First-in-first out types of computations are efficiently supported by stacks.

    II. Implementing queues on a linear array with two indices is more efficient then implementing queues on a circular array.

    III. The best data structure to check whether an arithmetic expression has balanced parenthesis is a queue.

  • Question 10
    2 / -0.33

    What is the postfix expression corresponding to the infix expression?

    x – y + z ^ a × b ^ c / d + e

    In the above expression, ^ is exponentiation operator, × is multiplication operator, / is division operator, + is addition operator and – is subtraction operator also ×, + and – are left associative wile ^ is right associative.

  • Question 11
    2 / -0.33

    Consider the following C program:

    #include<stdio.h>

    #include<string.h>

    int main()

    {

        char *t = "GATECSITtwenty-20";

        char *p = t;

        printf("%d", (int)strlen(p + 3[p]-4[p] + 1));

        return 0;

    }

    The output of the above code is ____.

  • Question 12
    2 / -0.33

    Consider the following C program:

    #include <stdio.h>

    int main () {

    float s = 0.0, m = 1.0, n = 2.0;

    while (n/m>= 0.03125) {

    m = m + m;

    s= s + n/m;

    printf(" % .4f \n", s);  //line 7

    }

    return 0;

    }

    The number of times line 7 will be executed is _______.

  • Question 13
    2 / -0.33

    Consider the below given code?

    #include <stdio.h>

    int main()

    {

    int ary[ ] = {1, 3, 5, 7, 9, 11};

    int k, count = 0, *p = ary + 4;

    for (k = 0; k < 6; k++)

    count = count + (*p - k) - *(p - k);

    printf ("%d \n",count);

    return 0;

    }

    What is the value printed after the code execution?

  • Question 14
    2 / -0.33

    What is the output in a 32 bit machine with 32 bit compiler?

    #include<stdio.h>

    rer(int **ptr2,int **ptr1)

    {

        int*ii;

        ii=*ptr2;

        *ptr2=*ptr1;

        *ptr1=ii;

        **ptr1 *= **ptr2;

        **ptr2 += **ptr1;

    }

    void main( )

    {

        int var1=5, var2=10;

        int *ptr1=&var1, *ptr2=&var2;

        rer(&ptr1, &ptr2);

        printf(“%d %d “,var2, var1);

    }

Submit Test
Self Studies
User
Question Analysis
  • Answered - 0

  • Unanswered - 14

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
Submit Test
Self Studies Get latest Exam Updates
& Study Material Alerts!
No, Thanks
Self Studies
Click on Allow to receive notifications
Allow Notification
Self Studies
Self Studies Self Studies
To enable notifications follow this 2 steps:
  • First Click on Secure Icon Self Studies
  • Second click on the toggle icon
Allow Notification
Get latest Exam Updates & FREE Study Material Alerts!
Self Studies ×
Open Now