Which of the following uses only increment operations for adding and removing element at either end?
Queues
In an array implementation, each linear data structure keeps index variables for its ends; the question is which structure only ever moves those indices forward (increment, modulo the size in a circular array).
Step 1 — Queue: insertion (enqueue) takes place at the rear, REAR = REAR + 1; deletion (dequeue) takes place at the front, FRONT = FRONT + 1. Elements are added at one end and removed at the other, and both pointers only increase.
Step 2 — Stack: push does TOP = TOP + 1 but pop does TOP = TOP − 1, so a decrement is required.
Step 3 — Deque (double-ended queue): inserting at the front needs FRONT = FRONT − 1 and deleting at the rear needs REAR = REAR − 1, so decrements are unavoidable.
Step 4 — Priority queue: deletion removes the highest-priority element, not the element at an end, and a heap implementation shrinks its size with a decrement and sifts elements up and down.
Queues option is correct.
The breadth first search will use a _______ as a structure to hold nodes nor further processing.
Let $u(x, t)$ be the solution of the following initial-boundary value problem
$\frac{\partial u}{\partial t} - \frac{\partial^2 u}{\partial x^2} = 0$, $\quad x \in (0,\pi)$, $t > 0$,
$u(0,t) = u(\pi,t) = 0$, $u(x, 0) = \sin 4x \cos 3x$.
Then, for each $t > 0$, the value of $u(\frac{\pi}{4},t)$ is
| List I | List II |
| A. Circular Queue | I. Print Queue |
| B. Priority Queue | II. CPU Scheduling |
| C. Double Ended Queue | III. Dijkstra algorithm |
| D. Simple Queue | IV. Palindrome checking |