Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors

GATE CS 2021 Stack and Queue

Consider the following sequence of operations on an empty stack.

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();

The value of s+q is ___________.

View answer

86

Practice Problem

Consider the following sequence of operations on an empty stack.

Push(40); push(41); pop(); push(43); push(44); s=pop();

Consider the following sequence of operations on an empty queue.

enqueue(11); enqueue(12); dequeue(); enqueue(13); enqueue(14); q=dequeue();

The value of s+q is ___________.

Leave a Comment