Self Studies

Programming and...

TIME LEFT -
  • Question 1
    1 / -0

    Consider the below-given queue

    REAR

    102

    78

    21

    95

    16

    15

    17

    FRONT

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

  • Question 2
    1 / -0

    The following sequence of operations is performed on a stack:

    PUSH(50), PUSH(60), PUSH(70), POP, POP, PUSH(80), PUSH(90), PUSH(100), PUSH(110), POP, PUSH(120) PUSH(130), POP, POP, PUSH(140), POP

    The sequence of values popped out is:

  • Question 3
    1 / -0

    Which is the postfix of the below given expression:

    P + Q – R * (S + T) / V

  • Question 4
    1 / -0

    Consider a C function given below:

    void gateCS2021(struct ListNode* head){

    int result = 0;
    while(head) {
    result = 2*result + head->val;
    head = head->next;
    }
    printf("%d", result)

    }

    Input Linked list:  1 → 0 → 1 → 1 → 0 → 0 →1 →1 →0 → 1.

    What is the value printed by gateCS2021()?

  • Question 5
    1 / -0

    A program attempts to generate as many permutations as possible of the integer 1, 2, 3, 4, 5 by pushing in the same order onto a stack, but it may pop off the top character at any time. Which of the following numbers can be generated using this program?

    I. 5 4 3 2 1

    II. 3 2 1 4 5

    III. 1 2 3 4 5

  • Question 6
    1 / -0

    If a queue is implemented using two stacks. In enqueue operation, all the elements are pushed from the first stack to the second stack. In dequeue operation pop an element from 1st stack.

    What is the time complexity of enqueue and dequeue operation?

  • Question 7
    1 / -0

    What does head returns in the the below given function?

    struct ListNode* Decrease_List(struct ListNode* head){
    struct ListNode *p = head;
    if(p == NULL)
    return head;
    while(p->next != NULL)
    {
    if(p->val == p->next->val)
    p->next = p->next->next;
    else
    p = p->next;  
    }
    return head;
    }
    }

    Definition for a singly-linked list is given below
     struct ListNode {
     int val;
     struct ListNode *next;
     };

  • Question 8
    1 / -0

    What is the result by evaluating the given postfix expression:

    80 10 – 48 12 / * 6 + 7 6 +  –

    In the above expression * is multiplication operator, / is division operator, + is addition operator and – is subtraction operator

Submit Test
Self Studies
User
Question Analysis
  • Answered - 0

  • Unanswered - 8

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
Submit Test
Selfstudy
Selfstudy
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