GATE DA 2024 — Question 32

Programming, Data Structures and Algorithmsbasic data structures: stacks, queues, linked lists, trees, hash tablesNAT1 markEasy

The fundamental operations in a double-ended queue D are: insertFirst(e) - Insert a new element e at the beginning of D. insertLast(e) - Insert a new element e at the end of D. removeFirst() - Remove and return the first element of D. removeLast() - Remove and return the last element of D. In an empty double-ended queue, the following operations are performed:
code
1insertFirst(10)
2insertLast(32)
3a ← removeFirst()
4insertLast(28)
5insertLast(17)
6a ← removeFirst()
7a ← removeLast()
8
The value of a is ______.
Practise the full 2024 paper
Challenge a friend: WhatsApp Telegram
From RENYXERAFree All-India Mock — every SundayA full GATE CS paper, exactly 180 minutes, ranked across India with your GATE score.
Practise more on basic data structures: stacks, queues, linked lists, trees, hash tablesTimed, in the real exam interface · free to start

A GATE question every morning

One real past-paper question every morning for your branch, answer hidden until you tap. Free on Telegram.

Join
Stuck? Ask in the student group