NAT · 2 marks · Linear Data Structures
GATE CS 2023 CS — Q59
Consider a sequence of elements , and . The following operations are performed on a stack and a queue , both of which are initially empty.
I:
II:
III:
IV:
V:
VI:
VII:
VIII: Repeat operation VII three times.
IX:
X:
The
I:
push the elements of from to in that order into .II:
enqueue the elements of from to in that order into .III:
pop an element from .IV:
dequeue an element from .V:
pop an element from .VI:
dequeue an element from .VII:
dequeue an element from and push the same element into .VIII: Repeat operation VII three times.
IX:
pop an element from .X:
pop an element from .The
top element of after executing the above operations is ____________.