Consider the following sequence of operations on an empty stack.…

GATE · 2021 · CS · Set 1 · Computer Science & IT

Consider the following sequence of operations on an empty stack.

Push(54);push(52);pop();push(55);push(62);s=pop();Push(54);push(52);pop();push(55);push(62);s=pop();

Consider the following sequence of operations on an empty queue.

enqueue(21);enqueue(24);dequeue();enqueue(28);enqueue(32);q=dequeue();enqueue(21);enqueue(24);dequeue();enqueue(28);enqueue(32);q=dequeue();

The value of s + q is ________.

Attempted by 289 students.

Sign up free to check your answer

Sign up free

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…