GATE Programming and Data Structures: Stacks and Queues – Previous Year Questions
9 GATE previous year questions on Stacks and Queues (Programming and Data Structures, Computer Science) with answers and explanations, from every paper.
- GATE 2016 CS Q20 – A queue is implemented using an array such that ENQUEUE and DEQUEUE operations are performed efficiently. Which one of the following statements is…
- GATE 2016 CS Q51 – Let Q denote a queue containing sixteen numbers and S be an empty stack. Head(Q) returns the element at the head of the queue Q without removing it…
- GATE 2018 CS Q13 – A queue is implemented using a non-circular singly linked list. The queue has a head pointer and a tail pointer, as shown in the figure. Let n denote…
- GATE 2026 CS (CS2) Q50 – Consider a stack S and a queue Q, both initially empty and each capable of storing ten elements. The elements 1, 2, 3, 4, and 5 arrive one by one in…
- GATE 2025 CS (CS2) Q45 – Consider a stack data structure into which we can PUSH and POP records. Assume that each record pushed in the stack has a positive integer key and…
- GATE 2024 CS (CS2) Q48 – Let S1 and S2 be two stacks. S1 has capacity 4 and already holds 100, 200, 300, 400 (400 on top). S2 has capacity 2 and is empty. Operations: PushToS2…
- GATE 2023 CS Q59 – Consider a sequence a of elements a 0 = 1, a 1 = 5, a 2 = 7, a 3 = 8, a 4 = 9, and a 5 = 2. The following operations are performed on a stack S and a…
- GATE 2022 CS Q62 – Consider the queues Q 1 containing four elements (1, 2, 3, 4 with 1 at the head) and Q 2 containing none (shown as the Initial State in the figure).…
- GATE 2021 CS Q31 – Consider the following sequence of operations on an empty stack. push(54); push(52); pop(); push(55); push(62); s = pop(); Consider the following…